I'm having a problem copying the data (value) from one record to another only when the field type of ftLargeint. If the field is of this type, the value is not assigned. Below is a snipet of code; query1 does a select * from a table and query2 does the same from the same table. When I loop through the fields from query1 and assign the values from there to a new record in query2 all values are properly assigned to the new record except those that are largeint. I have commented out the code that will work around the issue, but I was wonder why I have to do it this way (if the datatype is smallint it works fine also).
procedure TForm1.BitBtn2Click(Sender: TObject);
var
i: integer;
begin
with myquery2 do
begin
close;
Open;
insert;
for i := 1 to myquery1.FieldCount - 1 do
begin
// if fields.DataType in [ftLargeint] then
// fields.asinteger := myquery1.fields.asinteger
// else
fields.Value := myquery1.fields.Value;
end;
post;
end;
myquery1.Refresh;
end;
Problem with Large Integer
code formatting
Sorry for the code not being formatted as I did a cut-n-paste and the leading spaces were apparently removed.
dblookupcombo
I'm having the same issue with a TDBLookupCombo when the datasource field is integer or bigint (it is fine with small and medium), selecting a new value from the combo drop down list will put the dataset into edit mode, but the value does not change to the new value.
What is going on? Please help. I'm evaluating these components and if this sort of problem can't be resolved, I'd be hard press to purchase.
What is going on? Please help. I'm evaluating these components and if this sort of problem can't be resolved, I'd be hard press to purchase.
We reproduced the error but unfortunately couldn't fix it. The reason of this problem is that it's impossible to assign a value through TLargeIntField.Value (see unit DB, TLargeintField.SetVarValue).
For Lookup and Master-Detail you have to refuse from using ftLargeInt fields.
To copy values you should change a line
fields.asinteger := myquery1.fields.asinteger
to
TLargeIntField(fields).AsLargeInt := TLargeIntField(myquery1.fields).AsLargeInt
For Lookup and Master-Detail you have to refuse from using ftLargeInt fields.
To copy values you should change a line
fields.asinteger := myquery1.fields.asinteger
to
TLargeIntField(fields).AsLargeInt := TLargeIntField(myquery1.fields).AsLargeInt