I am using Delphi 3 Pro and have developed a program to analyse data from a local Access Db using an SQL Query and a BDE connection.
However, when trying to assign the values of fields returned by the query using FieldValue or FieldByName no data is inserted into the variables e.g.
MyOrderNo := FieldValue[Query.OrderNo];
or
MyOrderNo := FieldByName(Query.OrderNo).AsValue;
The variables have been decalred and are of the right type.
However, if I now add an EditBox to the form and write the contents of the variable to this (with appropriate type-conversion, of course) then suddenly the variable does have the correct contents!
e.g.
MyOrderNo := FieldByName(Query.OrderNo).AsValue;
EditBox1.Text := IntToStr(MyOrderNo);
Note that when stepping through the program line by line, MyOrderNo will now have the correct content.
Any ideas?
However, when trying to assign the values of fields returned by the query using FieldValue or FieldByName no data is inserted into the variables e.g.
MyOrderNo := FieldValue[Query.OrderNo];
or
MyOrderNo := FieldByName(Query.OrderNo).AsValue;
The variables have been decalred and are of the right type.
However, if I now add an EditBox to the form and write the contents of the variable to this (with appropriate type-conversion, of course) then suddenly the variable does have the correct contents!
e.g.
MyOrderNo := FieldByName(Query.OrderNo).AsValue;
EditBox1.Text := IntToStr(MyOrderNo);
Note that when stepping through the program line by line, MyOrderNo will now have the correct content.
Any ideas?