• Subject: Re: VB & ADO don't seem to handle numeric fields
  • From: "Peter Dow" <pcdow@xxxxxxxxxxxxxxx>
  • Date: Mon, 27 Nov 2000 07:01:28 -0800

Hi John,

I thought of that earlier and put in code to iterate through AS400RS fields
collection showing the name, actual size, defined size, and type:

RTCODE
 2
 10
 200
RTDESC
 13
 50
 200
RTAMT
 16
-1
 14

No trailing spaces as far as I can tell. I tried using the ordinal positions
(0 - 2) instead of names, and again, the 1st two work, but not the 3rd. It
gets the same "Invalid procedure call or argument".

What I can do is get it to successfully assign

       RateAmt = AS400rs.Fields("RTAMT")

when RateAmt is DIM RateAmt as Variant, but when I subsequently try to
assign that variant field to another field, I'm back to "Invalid procedure
call or argument."

Thanks for the suggestions though. Any other ideas?

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

----- Original Message -----
From: "John Taylor" <john.taylor@telusplanet.net>
To: <MIDRANGE-L@midrange.com>
Sent: Monday, November 27, 2000 6:10 AM
Subject: RE: VB & ADO don't seem to handle numeric fields


> Hi Peter,
>
>
> The error message that you're getting typically occurs when the field name
> that you've specified doesn't exist in the recordset. I had a problem a
> couple of months ago with the SQL host server not passing back a field
name
> to the ADO driver. I opened an APAR and the problem was resolved via PTF.
I
> don't have the number handy since I'm at home right now.
>
> You can do a simple test to determine if this is your problem.
>
> Place a breakpoint on the RateAmt line, and set a Watch on AS400rs. Run
the
> program, then expand AS400rs until you find the "RTAMT" field. Make a note
> of the data type & ordinal field position. (Of course, if you can't find
the
> "RTAMT" field, then you've found the problem.)
>
> Using the debugger window, try the following code:
>
> ?RateAmt = AS400rs.Fields(n)
>
> where "n" is the ordinal position.
>
> If you can access the data via ordinal position, then double check your
> spelling. Let us know what you find.
>
>
> Regards,
>
> John Taylor
> Canda
>
>
>
>
> > -----Original Message-----
> > From: owner-midrange-l@midrange.com
> > [mailto:owner-midrange-l@midrange.com]On Behalf Of Peter Dow
> > Sent: Sunday, November 26, 2000 9:49 PM
> > 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 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
> +---

+---
| 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
+---

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2019 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].