If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > ADO and Interbase

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-28-04, 09:05
_Marsu_ _Marsu_ is offline
Registered User
 
Join Date: Mar 2004
Location: FRANCE, Rennes
Posts: 3
Question ADO and Interbase

Hello !

Sorry for my English. I'm French.

I have a little problem...

I use Delphi 5 Entreprise. I want to connect
Interbase 6.0 with ADO.

I found free ADO providers but none of then
correctly run with this code :

ls_str := ADOQuery.FieldByName('TOTO').AsString;

With the function FieldByName, I have an except.
Adress violation.

Free ADO providers are Ok ?
My ADO provider is not correctly parameters ?

Uses Components :
TADOConnection,
TADOTable,
TADOQuery,
TDataSource.

Thank you for yours help.

_Marsu_.
Reply With Quote
  #2 (permalink)  
Old 03-30-04, 12:46
RDWilson2 RDWilson2 is offline
Registered User
 
Join Date: Feb 2003
Location: San Antonio, TX
Posts: 31
Address Exception

Is it possible that your connection has not been established and the query made Active when you are trying to access the field?

If the ADOQuery is not "Active" then you should expect an address exception when you try to get specific field information because you are referencing relative to an invalid pointer value.

Try walking through the code with a Watch on the ADOQuery status and make sure that it is "Active" when you get to the point in your code where you are accessing "ADOQuery.FieldByName('TOT').AsString.
__________________
Ralph D. Wilson II
email: rwilson@thewizardsguild.com
URL: http://thewizardsguild.com

"Any sufficiently advanced technology is indistinguishable from magic." A.C. Clark
Reply With Quote
  #3 (permalink)  
Old 03-31-04, 08:34
_Marsu_ _Marsu_ is offline
Registered User
 
Join Date: Mar 2004
Location: FRANCE, Rennes
Posts: 3
Thanks RDWilson2 for your answer.

My connection is Ok.

I can access fields with the code :
ADOQuery.Fields[0].Value;

I have the good value.
But i doesn't use the function FIELDBYNAME.
I have an except. Adress violation.

HELPS !!!!

_Marsu_
Reply With Quote
  #4 (permalink)  
Old 03-31-04, 10:41
RDWilson2 RDWilson2 is offline
Registered User
 
Join Date: Feb 2003
Location: San Antonio, TX
Posts: 31
Address violation exception

I know this may to sound a like I am being a bit patronizing but, please trust me, I am not. I am just taking you through the steps _I_ would follow when faced with this.

Have you checked to make sure that the field name is correctly spelled?

Can you access any _other_ fields with FieldByName?"
__________________
Ralph D. Wilson II
email: rwilson@thewizardsguild.com
URL: http://thewizardsguild.com

"Any sufficiently advanced technology is indistinguishable from magic." A.C. Clark
Reply With Quote
  #5 (permalink)  
Old 04-01-04, 15:02
_Marsu_ _Marsu_ is offline
Registered User
 
Join Date: Mar 2004
Location: FRANCE, Rennes
Posts: 3
Question

Excuse me...

I'm sure of the field name.

And no, i have the same Address violation with others
fields name.

But, I'm writing a little program and it works perfectly !??!!

I don't understand !!!

Thank you for your help RDWilson2.

_Marsu_ : go to sleep and stop drunk !!!!! ;-)
Reply With Quote
  #6 (permalink)  
Old 04-01-04, 16:57
RDWilson2 RDWilson2 is offline
Registered User
 
Join Date: Feb 2003
Location: San Antonio, TX
Posts: 31
ADOQuery's aer, in my experience, a bit quirky. ;-)
__________________
Ralph D. Wilson II
email: rwilson@thewizardsguild.com
URL: http://thewizardsguild.com

"Any sufficiently advanced technology is indistinguishable from magic." A.C. Clark
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On