Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with access db and delphi 7

Status
Not open for further replies.

billpoul

Programmer
Jan 28, 2010
4
GR
hello everyone and thanks for your help in advance.

i am using ADO connection in delphi 7 with an access db.
all of my queries are correct and also the names of my fields in access.
the problem is that some times i get the following error on select * from Table queries!

MyVal:= vartostr(fieldvalues['fieldName']);
the fieldname may dy ID autonumber or same text

ADOQuery 1! Field 'fieldname' not found

the think is that the field does exists.
when i press ok to the error message and if i try to do the same query again i may have no problem.

this queries must run automaticaly in my prog as a result i have a little problem here.

please help!
 
I've found that forgetting to Open the table prior to referencing it's fields will result in a 'Field not found' exception, rather than a 'Table not open' exception.
 
Hi,

no need for VarToStr! Normally you retreive your field like this:

MyFieldValue := ADOQuery1.FieldByName('MyField').AsString; (or .AsInteger, and son on...).

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
hi and thanks a lot for your replies!
i have found that there has been some kind of problem with the db relations, you see i was given the db form my partner and i had to build my apllication on it!
some times it is better to do some things by your self!
any way thanks again for your consideration!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top