Problem with LookUp in Combo and Grid

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
TommyEldrup
Posts: 3
Joined: Sat 30 Jun 2007 08:46

Problem with LookUp in Combo and Grid

Post by TommyEldrup » Sat 30 Jun 2007 09:06

I have 2 tables:
t1 has a relation to t2 with a field of type Integer (10) unsigned

I am trying to make a DBLookupComboBox and a Lookup in the CRDBGrid.

But no matter what I try, I get the error:
Cannot access field ManufactsID as type Variant.

The DBLookupComboBox seems to work, until I make a change. Then I get above error.

In the CRDBGrid I get the error, when Activating the table.

I have tried with MySQL 5.0 and 5.1 and I have tried to change the field type to Int (20) and Medium Integer (8). But I cannot see why this should be nessary.

I have been using microOlap's DAC and there was no problems!

Hope you can fix this/help me...

Kind regards,
Tommy

TommyEldrup
Posts: 3
Joined: Sat 30 Jun 2007 08:46

Post by TommyEldrup » Sat 30 Jun 2007 10:21

I have now installed ver 5.10 and changed the situation a bit.

Now I don't get the error in the CRDBGrid, it just show a blank dead field.

...

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 03 Jul 2007 07:09

I could not reproduce the problem.
Please send me a complete small sample at evgeniyD*crlab*com to demonstrate it, including script to create and fill table.

Also supply me the following information:
- exact version of your IDE (including personality name for Delphi 2005, and BDS 2006);
- exact version of MyDAC (including build number). You can see it in the About sheet of TMyConnection Editor;
- exact version of MySQL server and MySQL client. You can see it in the Info sheet of TMyConnection Editor.

TommyEldrup
Posts: 3
Joined: Sat 30 Jun 2007 08:46

Post by TommyEldrup » Tue 03 Jul 2007 09:16

I actually found a work around for this, here in the forum.

I am using INT(10) unsigned for my Primary/Forreign keys.

I changed them to INT(11) signed and it works! Both the DBLookupComboBox and the CRDBGrid.

Will this be fixed to work with unsigned integers? or long integers?

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 04 Jul 2007 13:47

This is not a MyDAC restriction. This is a restriction of Delphi code. Probably there is a patch for Delpi that fixes this problem.

Post Reply