Connection to MSSQL

Forum related to version 6.1.5 of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
musicones
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 09.09.2005, 13:10

Connection to MSSQL

Post by musicones »

Hi,

ich try to connect to an MSSQL 2000 Server with Zeos 6.1.5.

Now I get this Error Message:

Test_Connection: EZSQLException
at $004A0B63
Requested database driver was not found

Do I need an DLL file like i needed it for MySQL or Postgre? If so, where can I get it, there was noone in the Zeos package.

Is use

ZDbcADO;

to connect

Are that the right Connection classes for MSSQL or are there any other? I couldn't find any other files for MSSQL out of the ZDBc* category.

regards
musicones
guyvdb
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 23.08.2005, 07:54

Post by guyvdb »

do you have installed mdac?
for sqlserver you can use ado or dblib.
dblib is the old driver and is also included in mdac 2.x
you can install it from the microsoft site.
musicones
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 09.09.2005, 13:10

Post by musicones »

Is mdac supported by Zeos?
guyvdb
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 23.08.2005, 07:54

Post by guyvdb »

if you use ADO, you need mdac 2.x. (website microsoft)
if you use dbLIB (old driver SQLSERVER), you need ntwdblib.dll (search on the internet)

Both are supported by ZEOS.

dblib = protocol TZConnection = mssql
ado = protocol TZConnection = ado
musicones
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 09.09.2005, 13:10

Post by musicones »

Hi,

thanks for your Information.
After I had to see that mdac is part of WinXP Prof (that is what i use), I set up ZDbcAdo with ado as protocol this time. This was wrong, I had mssql as protocol using ZDbcAdo, ok now I know that couldn't work.

Now I've tried both with ADO and with DBLIB.

Error using ADO:

Test_Connection: EAccessViolation
at $004E9245

when trying to

Code: Select all

{**
  Destroys this object and cleanups the memory.
}
destructor TZAdoConnection.Destroy;
begin
 [B] Close;[/B]
  FAdoConnection := nil;
  inherited Destroy;
end;
in unit ZDbcAdo.


Error using DBLIB:

<it's translated from german, so it's not original message>

Test_Connection: EDBConnectionError
at $004A12CA
Connection wrong.
Error connecting user 'musicones'. Reason:
no confident SQL Server-Connection assigned.

<original german message>
Test_Connection: EDBConnectionError
at $004A12CA
Anmeldung falsch.
Fehler bei der Anmeldung für den Benutzer 'musicones'. Ursache: Keiner vertrauten SQL Server-Verbindung zugeordnet.


I'm a bit helpless. ADO doesn't work at all. I hope it's a small error using DBLIB, maybe wrong declaration of DBname?

Database := 'test_Data'; <-- maybe wrong here, I tried different but no reaction at all
HostName := 'localhost';
Password := 'xxxxxxx';
Port := 0;
UserName := 'musicones';

thanks a lot till now and regards
musicones
musicones
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 09.09.2005, 13:10

Post by musicones »

Hi folks,

after a hard work I found out the reason for my connection problems, it su..s.

OK, here we are for all others who might find that there isn't enough good information:

Database := 'test'; <- ONLY Alias name, not filename
HostName := 'myPCNameInNetwork';
Password := 'sadmin';
Port := 0;
UserName := 'sa';

On MSSQL Installation I could choose the authentication type. I used Windows authentication. OK for MSSQL not OK for Zeos, why ever, I couldn't get it work.

Changing it to mixed authentication, username and password or Windows, I could connect to MSSQL test DB, after changing from filename to alias DB name also.

You see, not real a big problem but took me about one week to find the solution, what the hell...

regards
musicones
User avatar
ste_ba
Zeos Dev Team
Zeos Dev Team
Posts: 29
Joined: 15.02.2006, 20:26
Location: Lahntal
Contact:

Post by ste_ba »

Hi,

I tried this but I keep getting the error message

[Microsoft][ODBC Driver Manager] Der Datenquellenname wurde nicht gefunden, und es wurde kein Standardtreiber angegeben.

which translates roughly into

[Microsoft][ODBC Driver Manager] name of data source not found, and no standard driver entered

I use XP home.

Any ideas?

ste_ba
pol
Senior Boarder
Senior Boarder
Posts: 91
Joined: 13.10.2005, 08:19

Post by pol »

Hi,

I suppose the odbc data source does exist? (ODBC-Datenquellen-Administrator - System-DSN or Datei-DSN) I had exactly the same error message one of these days when I tried to open an old program relying on an odbc data source which had long gone.

Regards,
Rüdiger
User avatar
ste_ba
Zeos Dev Team
Zeos Dev Team
Posts: 29
Joined: 15.02.2006, 20:26
Location: Lahntal
Contact:

Post by ste_ba »

Hi Rüdiger,

I'm sorry for not being an ODBC expert, but how do I enter MS SQL databases into the ODBC data source administrator?

I tried to connect to various system databases of the MSDE by typing their names into the "database" property of the ZConnection.

ste_ba
User avatar
ste_ba
Zeos Dev Team
Zeos Dev Team
Posts: 29
Joined: 15.02.2006, 20:26
Location: Lahntal
Contact:

Post by ste_ba »

Made it! :-)

After I entered the ODBC data source, I discovered that I had to enter more than the database name as "database" property. The button next to the property led me to a wizard which generated the property value

Code: Select all

Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=MY_DB_NAME;Data Source=MY_PC_NAME
However, I wonder how I should know what my customers will have to enter here, especially for "Provider". Is it always SQLOLEDB.1?

ste_ba
pol
Senior Boarder
Senior Boarder
Posts: 91
Joined: 13.10.2005, 08:19

Post by pol »

Well, the wizard is a wizard and should know...
I think it's always SQLOLEDB.1, but I'm not sure, it's a long time since I have done that. Anyways, it has to be done on your clients' machines too, so you will see what happens.

Regards,
Rüdiger
Post Reply