Parameter database, bug?

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
LeonardoAG
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 05.04.2012, 14:52

Parameter database, bug?

Post by LeonardoAG »

I'm trying to access a SQL Server database remotely, but when I put the component zconnection1.connection:=true gives an error "Could not locate entry in sysdatabases for database 'db'."

I put as parameter database:='db-6427', seems to be omitted after the "-".

Is it a bug of the component?

I'm using Lazarus 0.9.30 and ZeosLib 6.6.6-stable

Sorry bad english
You do not have the required permissions to view the files attached to this post.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

LeonardoAG,

it could be a bug. Can you try to find out whats going wrong?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
LeonardoAG
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 05.04.2012, 14:52

Post by LeonardoAG »

Only putting the parameters in the component's properties in Object Inspector appears the error.

Database = db-6427
HostName = sql1.litoral.com.br
Password = XXXXXX
Protocol = mssql
User = XXXXX

When you place connected = true, the error appears.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

can you please switch to 7.0.0 alpha? It's FPC-stable but not for Delphi2009_UP.

some informations concering the latest Zeos updates:
http://zeos.firmos.at/viewtopic.php?t=3431

follow this thread:
http://zeos.firmos.at/viewtopic.php?t=841

try the testing or testing-egonhugeist branch..

Is the problem the same?

best regards
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
LeonardoAG
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 05.04.2012, 14:52

Post by LeonardoAG »

I tried with new version 7.0 and continues to have the same error
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Wich Server are you using here?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
LeonardoAG
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 05.04.2012, 14:52

Post by LeonardoAG »

SQL Server 8.0.194
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

LeonardoAG,

I've checked our sources for possible issues which are able to cut the DataBase string. But my quickly look for something like that doesn't result such an issue.

I'm not a MSSSQL expert but i think this message occours if Zeos try's to load some MetaData-Inforamations.

So are there eventuelly some suitable debug results?

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

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

Post by mdaems »

Please try if entering double quotes around the database same helps. Mssql apparently uses double quotes for identifier quoting (so special characters can be used for identifier names).

Mark
Image
LeonardoAG
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 05.04.2012, 14:52

Post by LeonardoAG »

Had already attempted in version 6.6.6, now with version 7.0.0 still gives error.

When I put quotes appears the error image attached
You do not have the required permissions to view the files attached to this post.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

OK, whithout the quoutes then...

Did you try to see what query is sent to the database exactly by using a TZSQLMonitor? (Add to your project somewhere and let it write to a log file.

That way we can verify what query gives this problem. It might very well not be your query, but a metadata fetching query that doesn't handle special table names very well.

Mark
Image
LeonardoAG
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 05.04.2012, 14:52

Post by LeonardoAG »

Logfile:

2012-05-15 11:59:24 cat: Connect, proto: mssql, msg: CONNECT TO "sql1.litoral.com.br" AS USER "usr6427"
2012-05-15 11:59:24 cat: Connect, proto: mssql, msg: USE db-6427, errcode: 0, error: General SQL Server error: Check messages from the SQL Server.
Could not locate entry in sysdatabases for database 'db'. No entry found with that name. Make sure that the name is entered correctly.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

LeonardoAG,

Happy birthday!

Concerning your reported issue: Try to escape this "-" with "\-" between. I know some Objects of MSSQL must be escaped. But this seems to has dependencies to the version of the server.

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply