Page 1 of 1

Parameter database, bug?

Posted: 05.04.2012, 16:00
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

Posted: 05.04.2012, 18:13
by EgonHugeist
LeonardoAG,

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

Posted: 05.04.2012, 20:12
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.

Posted: 05.04.2012, 21:33
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

Posted: 23.04.2012, 21:47
by LeonardoAG
I tried with new version 7.0 and continues to have the same error

Posted: 23.04.2012, 21:59
by EgonHugeist
Wich Server are you using here?

Posted: 23.04.2012, 22:09
by LeonardoAG
SQL Server 8.0.194

Posted: 25.04.2012, 17:03
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

Posted: 26.04.2012, 00:31
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

Posted: 30.04.2012, 16:30
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

Posted: 05.05.2012, 20:17
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

Posted: 15.05.2012, 16:00
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.

Posted: 16.05.2012, 12:37
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