Error during execution SQL Queries

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
doctor
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 11.01.2008, 02:04
Contact:

Error during execution SQL Queries

Post by doctor »

Hi all,
I have installed Mysql 5 server on localhost and C++ Builder 6 as programming environment.The database is named 'test', the table is named 'tasks'. Table 'tasks' has 3 fields: id, city and zip-code.

I want to build a simple sql application.
I placed on form the following components:
ZConnection, ZTable, DataSource and DBGrid.
I have the following components on my BCB:

[web]http://sourceforge.net/dbimage.php?id=95426[/web]
and Button component with the following OnClick action:
ZConnection->Connect;
ZTable->Active = true;
The output data is redirecting on DBGrid component.

During executing the action, I get a message
Column with name "Extra" was not found
What I can to do?

PS. When I placed ZQuery and the query was "SHOW COLUMNS FROM tasks" that was OK, DBGrid showed all column.
Thanks for help.

Regards
klchin
Senior Boarder
Senior Boarder
Posts: 65
Joined: 02.09.2005, 06:27

Post by klchin »

Hi,

Pls. do check your SQL statement and your db table.

Regards,
KL Chin
doctor
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 11.01.2008, 02:04
Contact:

Post by doctor »

Login and passwords to database is good, sure.
When I use ZTable, I didn;t write any SQL query, but I set Connection parameter in ZTable compoenent on ZConnection, then I try set
ZTable Active feature on true. But then is message 'column with name extra was not found'.

My Zeos version: ZEOSDBO-6.6.2-rc.zip

I have read the article:
Problem with Zeos

this is the same problem, but I dont have a ZDbcResultSetMetadata component and GetColumnIndex method.

What I should to do ? :?:
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Welcome on the forum, doctor
The ZDbcResultSetMetadata object isn't a component but a helper object used by TZTable to decide which fields are available.
So to research this thing you'll have to debug the zeoslib code...
But first things first.
- Let's check what mysql client dll you're using. Just use the ZConnection.ClientVersionStr (eventually also ServerVersionStr) once connected.
- Check if this problem also exist when you use the dll version we used for testing. You'll have to download one of our snapshots (http://zeosdownload.firmos.at/downloads/snapshots/, dont use the 'COMPACT' version). There's a 'lib' directory containing our dll's for testing. Copy libmysql50.dll next to your executable. (attention , not libmysqlD50.dll)

Mark
Image
doctor
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 11.01.2008, 02:04
Contact:

Post by doctor »

Thanks a lot mdaems,
Program works properly now :D :D
You are great.

When I copied the dll to the project directory, no errors is shows.

When I will make an official version of the program I have 2 possibilities to load libmySQL50.dll driver:
-copy the library to systems32/drivers
-dynamic load the library in local folder

That's right ? :lol:
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

That's right. What version were you using? Just for the information of other readers. And if it's a more recent one than ours we'll have to fix the issue...

Mark
Image
doctor
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 11.01.2008, 02:04
Contact:

Post by doctor »

I have downloaded the
ZEOSLIB_TESTING_REV329.zip file, then I have copied the libmysql50.dll do directory with an executable file.

Regards
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

I wanted to ask what libmysql version you were using before as that probably was the cause of the problem. The functions I mentioned above are useful when you want to investigate that.

Mark
Image
doctor
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 11.01.2008, 02:04
Contact:

Post by doctor »

Before it, I used libmysql40.dll.
It was an error, probably.
Post Reply