Article View: borland.public.cppbuilder.database.ado
Article #3903Re: Access violation for FieldByName
From: MarkR
Date: Tue, 18 Jun 2002 21:48
Date: Tue, 18 Jun 2002 21:48
36 lines
2116 bytes
2116 bytes
Save yourself time in future by using more meaningfull variable names, even
if they are only in scope for a few iterations of a loop. Typing a few
characters could have saved you much time and effort.
e.g. nCtr in place of just j
Just a thought.
"Claudia" <claudiam@paratransit.org> wrote in message
news:3d01016a$1_1@dnews...
> Never mind this question. It was a stupid error on my part. I should have
> used "j" instead of "i". You've got to love these kinds of stupid errors.
>
> "Claudia" <claudiam@paratransit.org> wrote in message
> news:3d00f724_2@dnews...
> > I want to update a table from a text file. For every given string in a
> line
> > I want to use FieldByNumber to add it to the table but it's giving me an
> > access violation error on
> > TempTable->Fields->FieldByNumber(i+1)->AsVariant
> >
> > Here's what my code looks like:
> >
> > TempTable->Open();
> > TempTable->First();
> >
> > TempTable->Insert();
> > for (int j=0;TempTable->Fields->Count > j; j++)
> > {
> >
> TempTable->Fields->FieldByNumber(i+1)->AsString=FieldValue;
> > }
> > TempTable->Post();
> > TempTable->Close();
> >
> >
>
>
Technical Details
Message-ID:
<3d0faa77$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3d00f724_2@dnews> <3d01016a$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,aeb35031d8a9deae X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-06-18 14:59:11 PST From: "MarkR" <mark.richards8@wapthespamntlworld.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3d00f724_2@dnews> <3d01016a$1_1@dnews> Subject: Re: Access violation for FieldByName Date: Tue, 18 Jun 2002 22:48:40 +0100 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 213.107.139.203 Message-ID: <3d0faa77$1_1@dnews> X-Trace: dnews 1024436855 213.107.139.203 (18 Jun 2002 14:47:35 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews