Link to home
Start Free TrialLog in
Avatar of drnadeem
drnadeem

asked on

Delphi 7 and MySQL

I am using ADO to connect to a mySQL database. Connection works fine, but when I use TADOTable to view data (ADOTable1.Active := True) I get an error "Invalid Field Size". Can anyone explain why this is?

Here is the structure of my database:

Field         Type      Null    Key     Default  Extra
------------  --------  ------  ------  -------  ------
Number        int(15)           PRI     0              
Name          char(30)  YES             (NULL)        
ID_Card       char(10)  YES             (NULL)        
Address       char(30)  YES             (NULL)        
Street        char(30)  YES             (NULL)        
District      char(15)  YES             (NULL)        
Appl_Date     date      YES             (NULL)        
Insvc_Date    date      YES             (NULL)        
Cust_Class    char(1)   YES             (NULL)        
Listed        char(5)   YES             (NULL)        
Desng_pos     int(3)    YES             (NULL)        
Designtn_E    char(30)  YES             (NULL)        
Used_as       char(1)   YES             (NULL)        
Island        char(15)  YES             (NULL)        
Atoll         char(15)  YES             (NULL)        
Line_type     char(1)   YES             (NULL)        
Dis_Date      date      YES             (NULL)        
Direntry_E    char(30)  YES             (NULL)        
Enter_date    date      YES             (NULL)        
Direntry_T    char(30)  YES             (NULL)        
Designtn_t    char(30)  YES             (NULL)        
In_Directory  char(5)   YES             (NULL)        
OG_Bar        char(5)   YES             (NULL)        
IC_Bar        char(5)   YES             (NULL)        
Pincode       char(5)   YES             (NULL)        


Thanks in Advance

Avatar of aikimark
aikimark
Flag of United States of America image

My guess would be
Desng_pos     int(3)    YES             (NULL)        

================
My reasoning:
int(3) is a very unusual size for an integer field.  Change it to int(4) and try it again.
Avatar of drnadeem
drnadeem

ASKER

Nope...that does not solve the problem
ASKER CERTIFIED SOLUTION
Avatar of prevarant
prevarant

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
  Hi!


Have you tried to use ZeosDBO version 6.5.x (www.zeoslib.net).
I have used those components with MySQL with very good results and
no problem at all.
I got similar errors when trying to use ADO or DBExpress with MySQL
and substituted ADO and DBExpress with ZeosDBO and have used those components
since with MySQL.

Regards,
 Tomas Helgi