I'm trying to establish a connection to a MS SQL Server 2008 Express using the Freetds driver in zeos.
But so far without any success .
I've googled around, but did not find any configuration which was working. Or even any code snippet which would lead me into the correct direction.
Now I'm wondering, if I insert the correct values into the TZConnection object.
Here's a code snippet of what I did:
Code: Select all
zCon : TZConnection;
zCon.Protocol := 'FreeTDS_MsSQL>=2005';
zCon.LibraryLocation := GetCurrentDir + '\database\mssql\sybdb.dll';
zCon.Database := 'testdb';
zCon.HostName := 'win7vm'; //Details see below
zCon.Port := 1433; //Tried with configuring port and without (default 1433)
zcon.User := 'dummyuser';
zCon.Password := 'dummypassword';
zCon.Connect; //<= Error or endless timeout comes up here
on e : Exception do ShowMessage('Error Class: '+e.ClassName + ' Error Message:' +e.Message);
I've also configured the SQL server:
- added local sql user (not NT Auth)
- allow remote connections
- TCP/IP protocol enabled
- Firewall ports opened
- Databasenames as quoted strings (tried with and without)
Today I've switched zeos to the testing-7.3 repo and replaced the old ms*.dlls with the single sybdb.dll from the zeos svn repo
I played around with the server names like:
I tested the optional properties secure and/or trusted
Connections to SQLite, Firebird 2.5, MySQL, PostgreSQL are all ok. Only MSSQL refuses the connection.
Any help is really appreciated