Page 1 of 1

DBLookupComboBox: variant error

Posted: 14.01.2008, 15:07
by Jona
Hi everyone,

I'm using Delphi 7 + Zeos 6.6.1 beta + MySQL5 and have a table TC where field TCTypeID refers to a value in table TCType. On a form I've added a DBLookupCombobox and set it's parameter like:

DataField = TCTypeID
DataSource = DSTC

ListSource = DSTCType
ListFieldName = TCType
KeyFieldName = TCTypeID

Now the Combobox contains all TCTypes (like it should) but when I select a different value from the drop down list I get an error: "Cannot access field 'TCTypeID' as type Variant".
I've checked if both TCTypeID have the same datatype and both are int(10) unsigned.

If I change the TCTypeID manually from within a normal DBEdit box the TCType in the DBLookupComboBox is changed. So it seems that the Combobox is working properly.

Any idea how this can be fixed?

Thanks,
Jona

Posted: 14.01.2008, 16:02
by mdaems
If you package a sample project + database script + instructions I can debug it. I suppose it will involve vcl debugging, so give me some time...

Mark

Posted: 15.01.2008, 10:01
by Jona
Hi Mark,

attached source code from a small sample application + DB create and some instructions.

Thanks,
Jona

Posted: 15.01.2008, 17:01
by Jona
I've managed to fix the problem. Seems it's related to building the application with or without runtime packages.
If the 'build application with runtime packages' option (in project options) is checked the DBLookupCombobox works flawless.

Best regards,
Jona

Posted: 16.01.2008, 13:42
by mdaems
Strange... Should we investigate this further?

Mark

Posted: 17.02.2010, 04:16
by mcsoares
Jona, Hello friends, I am having problems with dblookupcombobox, for example have a table and the table CUSTOMER CITY, when I'm registering a client I click the dblookupcombobox and he shows me all the cities Indexed .. so far so good ... However when I select any city it's a variant of error, following error: "EDatabaseError whit message'Cannot access field 'codicia' as type Variant 'Process stoped. I realized that there are several colleagues with the same problem but no solution. If someone can help me please reply to this topic or send email to marcio@visaosistemas.com.br. Thanks for attention. I am using Delphi7 Mysql5.1 and Zeos 7.0.0.

Posted: 17.02.2010, 20:13
by mdaems
Hi,

Did you try using the switch shown by Jona?

Mark