Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Delphi 7 and MySQL

Posted on 2005-03-27
4
Medium Priority
?
510 Views
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

0
Comment
Question by:drnadeem
4 Comments
 
LVL 46

Expert Comment

by:aikimark
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.
0
 
LVL 1

Author Comment

by:drnadeem
ID: 13642614
Nope...that does not solve the problem
0
 
LVL 2

Accepted Solution

by:
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

Regards
Marko
0
 
LVL 26

Expert Comment

by:Tomas Helgi Johannsson
ID: 13646698
  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
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This is an update to some code that someone else posted on Experts Exchange. It is an alternate approach, I think a little easier to use, & makes sure that things like the Task Bar will update.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

572 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