DBLookupComboBox: variant error

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Jona
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 14.01.2008, 14:35

DBLookupComboBox: variant error

Post 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
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
Jona
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 14.01.2008, 14:35

Post by Jona »

Hi Mark,

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

Thanks,
Jona
You do not have the required permissions to view the files attached to this post.
Jona
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 14.01.2008, 14:35

Post 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
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Strange... Should we investigate this further?

Mark
Image
mcsoares
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 17.02.2010, 00:51
Contact:

Post 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.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi,

Did you try using the switch shown by Jona?

Mark
Image
Post Reply