🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
2 messages
2 total messages Started by Mike K Thu, 30 Aug 2007 14:49
FieldByName() throws exception
#111
Author: Mike K
Date: Thu, 30 Aug 2007 14:49
20 lines
1219 bytes
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
Re: FieldByName() throws exception
#112
Author: 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
>
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads