Page 1 of 1

Cannot access field 'Field' as type Variant.

Posted: Tue 22 Jan 2008 04:57
by FerCastro
Hello Fiends,

I have a DBLookupCombobox and it seems i have all the settings ok, but after I choose the data and lost the focus of the Combobox i get the message:

Cannot access field 'Field' as type Variant.

I don't know if the MyDac component has a bug working with the DBLookupCombobox, but I have tryed with several components (Delphi native, DBExpress, etc) and always get the same error.

Delphi 7
MyDac 4.40.0.18
WXP SP2

Thanks and best regards.

Fernando Castro
Mexico, D.F.

Solved..

Posted: Tue 22 Jan 2008 05:04
by FerCastro
Most probably, you use TLargeIntField (BIGINT or UNSIGNED INT). This field cannot be used as Lookup (see method TLargeintField.SetVarValue). Declare this field at the server as INT.

Thanks and please forgive any bother. I didn't see the post at first sigth.

Best regards

Fernando Castro
Mexico, D.F.

Posted: Tue 05 May 2009 09:44
by Karysf
I am using an embedded mysql database.

I'm using SELECT 1,2,3 kind of statements, and the problem is that mysql returns them all as BIGINT. Using a user created function to cast it to a simple int would be fine, but embedded database does not allow creation of custom user functions.

How to overcome this ? Is there a possibility to change the type of value on the component itself ?

Posted: Wed 06 May 2009 07:26
by Dimon
To solve the problem you should set the TMyConnection.Options.OptimizedBigInt property to True.

Posted: Wed 06 May 2009 07:56
by Karysf
I'm using version 3.55.0.25
Since wich version is this option available ?

Posted: Wed 06 May 2009 08:36
by Dimon
This option is availabled since MyDAC version 5.20.1.14.