🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #112

Re: FieldByName() throws exception

#112
From: Mark Richards
Date: Fri, 31 Aug 2007 21:16
29 lines
1605 bytes
Try

device = ADODataSet1->FieldByName("Device")->AsInteger;


"Mike K" <nospam@nospam.net> wrote in message 
news:46d6d913$1@newsgroups.borland.com...
> int device;
>
> // this code works:
> device = ADODataset1->Fields->Fields[7]->AsInteger;
>
> // this does not:
> device = ADODataset1->Fields->FieldByName("Device")->AsInteger;
>
> This throws this exception:
>
> " is not a valid floating point value.
>
>
> I remember having this problem before, and worked around it by using the 
> more cryptic Fields->Fields[] method, but this is driving me nuts. Anyone 
> know what is wrong here?
>
> TIA
>
> Mike
>
> 
Technical Details
Message-ID: <46d88515@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <46d6d913$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,a7a7c8887b6e7f5b
X-Google-Attributes: gid10698b,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mark Richards" <markcr@wapthespamntlworld.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <46d6d913$1@newsgroups.borland.com>
Subject: Re: FieldByName() throws exception
Date: Fri, 31 Aug 2007 22:16:08 +0100
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 81.103.92.168
Message-ID: <46d88515@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1188594965 81.103.92.168 (31 Aug 2007 14:16:05 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail