× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: VB & ADO don't seem to handle numeric fields
  • From: "Holliday, Gary" <Gary.Holliday@xxxxxxxxxxxxxx>
  • Date: Mon, 27 Nov 2000 09:42:31 -0000

Peter,

I have had similar error messages from VB, and I traced them to missing
object libraries, after much head scratching. One such error came up on the
CHR() function and when I removed a reference to a missing object library it
worked fine. It's possible that your problem is not in this actual line of
code but somewhere else.

HTH

Regards

Gary Holliday
----------------------------
Gary.Holliday@Smedleys.co.uk
Smedleys Foods
Wardentree Lane
Pinchbeck, Spalding
Lincs. PE11 3UY


-----Original Message-----
From: Peter Dow [mailto:pcdow@MailAndNews.com]
Sent: 27 November 2000 04:49
To: MIDRANGE-L@midrange.com
Subject: VB & ADO don't seem to handle numeric fields


Hi Everyone,

I've got a VB program that's reading a file from an AS400 using ADO. Of the
following 3 lines

        RateCode = AS400rs.Fields("RTCODE")
        RateDesc = AS400rs.Fields("RTDESC")
        RateAmt = AS400rs.Fields("RTAMT")

the first two work and the third one fails with run-time error 5 "Invalid
procedure call or argument". The left side fields are defined as

    Dim RateAmt As Currency
    Dim RateCode As String
    Dim RateDesc As String

On the AS400, WRKDBF shows the fields defined as:

  Seq. Base PF    Field Name Field Description         Key Tp  Pos  Len Dec
   1.0 RATEP      RTCODE                                 1 A     1    10
   2.0            RTDESC                                   A    11    50
   3.0            RTAMT                                    P    61    11  2

I'm using CA Express V4R4M0 Service Level SF63638 running under WinNT 4.0
build 1381 service pack 6; the AS400 in questions is John Ross's Netshare
TS400 which is at V4R4M0 with 5769XE1 *CODE & *LNG installed at V4R4M0 and
showing as *COMPATIBLE.

I've tried defining RateAmt as Currency (as shown), Double (how MS Access
using ODBC defines RTAMT), and Long with no luck. I've tried changing RTAMT
to zoned-decimal with no luck. I can't believe that IBM's ADO provider
doesn't do numeric fields, so what am I missing?

TIA,
Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax


This e:Mail and any files transmitted with it are confidential and intended
solely for the use of the individual to whom it is addressed.
If you have received this e-mail in error please contact Matthew Middleton
or Gary Holliday immediately by telephone on 01775 710789 or on e-mail at
Smedleys.IT@Smedleys.co.uk
Any views or opinions presented are solely those of the author and do not
necessarily represent those of Smedleys Foods.
Unauthorised publication, use, dissemination, forwarding, printing or
copying of this e-mail and its associated attachments is strictly
prohibited. 


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.