ERangeError by Query

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

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
hamza
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 31.01.2007, 17:06

ERangeError by Query

Post by hamza »

Hello,


I'm trying to use ZeosDBO6.6.0 with Turbo Delphi Prof (BDS 2006).

If I try to set "ZQuery1.active:= true" I get an ERangeError (in German: "Fehler bei Bereichsüberprüfung").

What can I 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 »

No idea, but your information is quite 'limited'.
Can you provide some detail information?
Does it fail for one specific query or for all queries? If only for a specific case, can you provide an easy reproduction setup (table creation script and failing query)?

Mark
hamza
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 31.01.2007, 17:06

Post by hamza »

mdaems wrote:No idea, but your information is quite 'limited'.
Can you provide some detail information?
Does it fail for one specific query or for all queries? If only for a specific case, can you provide an easy reproduction setup (table creation script and failing query)?

Mark
It fails for all SELECT-Queries (query.open).

I can insert data into the database but cannot read by "SELECT".

This is the code I wrote:

Code: Select all

ZQuery1.SQL.Text:= 'SELECT * FROM artikeldaten_stamm';
Zquery1.Open;
Here I get an error.

If I use "ExecSQL" instead of "Open" I don't get an error. But I also don't get any data.

And with

Code: Select all

ZQuery1.SQL.Text:= 'INSERT INTO artikeldaten_stamm SET ' +
                   'bezeichnung = ''turbo delphi'', ' +
                   'barcode = 12981928';
ZQuery1.ExecSQL;
I cant insert a new line.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Strange, it must be a range check error while fetching the results. Maybe you use an incompatible dll for the protocol you selected (so we could point to the wrong places in buffers). Can you find the exact statement where the range check error occurs?

BTW, selects do work for most users, even for BDS2006...

Mark
hamza
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 31.01.2007, 17:06

Post by hamza »

Hi again,

I tried the same way with a Firebird 2.0-database and that works without any problems (The other database was Mysql5).
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 Hamza,

Did you not add the point where the failure was? I was thinking you wrote it failed on a call in the plain driver units.
This typically happens when the layout of the mysql buffers changed between versions. Did you use the DLL we provide and was your app actually loading this version? You can be a little more sure when you name the dll libmysql50.dll and put it in the same dir as your app. Early mysql 5 versions certainly have this problem. Also, when a mysql 4 dll is in your path, you may have this kind of trouble.

Mark
hamza
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 31.01.2007, 17:06

Post by hamza »

:wallb:

Ok. It was that!

I had already copied the dll in the application directory but it was mysqld50.dll and not mysql50.dll.

It would be better if there were an error message that the correct dll-file is missing in the directory.
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 agree this kind of problem is an horror. Problem her was that he actually found a dll (windows behaviour : if it finds a dll with the right name somewhere he's happy). So it used a dll in your path.

There is a way you can detect bad dll versions for mysql, however.
You can use the Serverversion properties of your connection. If you use the 6.6.1 release it should be included and working before you connect. Just check if serverversion > 5000000 (5.0.0) and you should be allright. (to be correct: there was also a different buffer layout in earlier dll versions for version 5, so you better use a number like 5000020.

A second solution is enabling the {$DEFINE MYSQL_STRICT_DLL_LOADING} directive in zeos.inc. That way only the dll with versioned name is tried.

Mark
Post Reply