Delphi 7 and MySQL

Posted on 2005-03-27
Medium Priority
Last Modified: 2010-04-05
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

Question by:drnadeem
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 46

Expert Comment

ID: 13639007
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.

Author Comment

ID: 13642614
Nope...that does not solve the problem

Accepted Solution

prevarant earned 750 total points
ID: 13642863
Hi drnadeem

Try setting OPTION=3 in connection string. It is the same as setting "Don't optimize column width" and "Return matching rows" in MyODBC configuration screen

LVL 25

Expert Comment

by:Tomas Helgi Johannsson
ID: 13646698

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.

 Tomas Helgi

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question