unknown MySQL Datatype

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
skepsis
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 08.03.2008, 10:13

unknown MySQL Datatype

Post by skepsis »

Hi everybody,

i use delphi 2007 and zeoslib 6.6.2, all of then installed on Vista os. I use ZConnection and I connect to a mysql db on my web server. The connection goes fine but when I place a ZTable and trying to make it active I receive a "Unknown mysql data type" error. I've use all the protocols but the same error all the time. :cry:

I would very appreciate if you advice me to look at something....
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

What version of the mysql client and server are you using? Try

Code: Select all

showmessage(ZConnection1.ClientVersionStr + '-'+ZConnection1.ServerVersionStr); 
after you opened the connection.

Mark
Image
QPRocky
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 23.08.2008, 09:30

Post by QPRocky »

I have same problem.

When I try

Code: Select all

showmessage(ZConnection1.ClientVersionStr + '-'+ZConnection1.ServerVersionStr); 
I get access violation error.
But I have MySQL 5.0 and zeos 6.3.3.

This is what I have added to ZQuery.SQL.text:
SELECT * FROM kissa;

and here's table which I added on MySQL
Image

What could be wrong?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

QPRocky,
Usually these access violations mean you are using a wrong libmysql.dll. Please try putting the libmysql of your server distribution into the same directory as your exe file. This avoids some other libmysql.dll file in your path is used. Normally libmysql versions above 5.0.20 should work well for mysql-5 protocol in zeos.

Mark
Image
alphawiz
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 17.09.2008, 18:46
Location: Jax, FL
Contact:

Re: unknown MySQL Datatype

Post by alphawiz »

skepsis wrote:Hi everybody,

i use delphi 2007 and zeoslib 6.6.2, all of then installed on Vista os. I use ZConnection and I connect to a mysql db on my web server. The connection goes fine but when I place a ZTable and trying to make it active I receive a "Unknown mysql data type" error. I've use all the protocols but the same error all the time. :cry:

I would very appreciate if you advice me to look at something....
I'm trying to build a simple application, using Delphi 7 and MySQL 4.1.

Here is what the app consists of.

A ZConnection component to connect to the MySQL database.
1 ZReadOnlyQuery. the query is select str from verifyme;
str field in the database is varchar(30) not null
1 TDataSource (delphi default) so that I can use the components to access the data
1 DBEdit to display the value of str.

But when I try to point anything to the str field, it dies with the error message of Unknown MySQL data type.

How can I use the standard delphi data access tools (or better yet, the Project JEDI tools) to use the data?

An example would be appreciated.
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 Alphawiz,

Is it the error in the ConvertMySQLHandleToSQLType function (ZDbcMysqlUtils.pas) that's showing?
Please put a debug point at the case statement in that function and check what value is returned from PlainDriver.GetFieldType(FieldHandle).
I don't have a mysql 4.1 installation running, so I can't check myself.

Mark
Image
Dr Mac
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 09.06.2008, 09:20

Post by Dr Mac »

Hi!

I ran into the same problem.
My 'Music' table is:
- MusicNr int(10)
- MusicTitle varchar(50)
- AlbumNr int(10)
- MusicLength time
- MusicPerformer int(10)
- MusicNote varchar(50)

When I send the query "select * from music" with ZQuery, I get an error "Unknown MySQL Datatype" from the ConvertMySQLTypeToSQLType function.

My system: Debian linux, FreePascal 2.2.2, Lazarus 0.9.26, MySQL 5.0.51

Any idea?


Edit:

I added breakpoint into the ConvertMySQLTypeToSQLType function, before the type selection. The TypeName result was ^char nil
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Can you file a bug report in the tracker (http://zeosbugs.firmos.at) and attach your sample project? (Just sources. Don't forget the db creation script.)

Mark
Image
Dr Mac
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 09.06.2008, 09:20

Post by Dr Mac »

Report sent.
Dionic
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 15.10.2009, 12:45
Contact:

Post by Dionic »

Hi people!
I have same problem.
Please write how that problem decide successfully.
User avatar
Pitfiend
Senior Boarder
Senior Boarder
Posts: 68
Joined: 12.12.2009, 07:27

Post by Pitfiend »

Hi mates, today I had a similar trouble with unknown MySql data types... after a detailed search, I find the damn cause: I had a dated libmysql.dll inside my delphi bin directory. How this happens, I don't know, but after deleting it, I didn't get any more weird errors again and everything else did what was expected.

So, my recomendation is that you search your paths to find any dated dll and remove it, just keep the fresh ones.

My current environment is:
- Delphi 7
- Zeoslib 6.6.6 stable
- MySql 5.1.38
Post Reply