Page 1 of 1

Error during execution SQL Queries

Posted: 11.01.2008, 02:24
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

Posted: 11.01.2008, 02:35
by klchin
Hi,

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

Regards,
KL Chin

Posted: 11.01.2008, 02:40
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 ? :?:

Posted: 11.01.2008, 09:31
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

Posted: 11.01.2008, 17:45
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:

Posted: 11.01.2008, 21:27
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

Posted: 11.01.2008, 23:50
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

Posted: 12.01.2008, 09:45
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

Posted: 13.01.2008, 23:31
by doctor
Before it, I used libmysql40.dll.
It was an error, probably.