Error on connection to a MS SQL server dblib.dll not found

Forum related to MS SQL Server

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Fernando
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 14.06.2021, 10:47

Error on connection to a MS SQL server dblib.dll not found

Post by Fernando »

Hi
I try to connect to a Ms Sql Server using MSSqlConnection component. When i try to open, setting connected value to true, i receive this error "Can not load DB-Lib client library "dblib.dll". Check your installation". This message its clear and easy to understand, but my problem is that i unknow where this library must be and from where get this library, and in what route must be set, in Windows 10.

Any support will be appreciatted, thanks
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Error on connection to a MS SQL server dblib.dll not found

Post by marsupilami »

Hello Fernando,
Fernando wrote: 14.06.2021, 10:57 I try to connect to a Ms Sql Server using MSSqlConnection component.
This sounds like you are not using Zeos but another component suite (sqldb?).
Fernando wrote: 14.06.2021, 10:57 When i try to open, setting connected value to true, i receive this error "Can not load DB-Lib client library "dblib.dll". Check your installation". This message its clear and easy to understand, but my problem is that i unknow where this library must be and from where get this library, and in what route must be set, in Windows 10.
Usually you would want to use FreeTDS for this. You could use one of the downolads in our files section on sourceforge - although these libraries are a bit outdated. Besides this, you can download precompiled versions from the FreeTDS continous integration site.
See this thread: viewtopic.php?f=15&t=120103

Best regards,

Jan
Fernando
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 14.06.2021, 10:47

Re: Error on connection to a MS SQL server dblib.dll not found

Post by Fernando »

Sorry Jan, you're right, I'm confused, it wasn't zeos, but sqldb. with ZEOS i also failed to connect to a Sql Server, te error was: "(path)client library ntwdblib.dll found but could not be loaded. Check compile-target and library compatibility.

Thanks for you help
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Error on connection to a MS SQL server dblib.dll not found

Post by marsupilami »

Hello Fernando,
Fernando wrote: 14.06.2021, 17:30 with ZEOS i also failed to connect to a Sql Server, te error was: "(path)client library ntwdblib.dll found but could not be loaded. Check compile-target and library compatibility.
That seems like you are building a 64 bits application. ntwdblib.dll never was distributed as a 64 bits dll. Also please don't use the ntwdblib.dll. Microsoft has discontinued development of ntwdblib.dll for almost 20 years now. Please use Freetds or ADO on Zeos 7.2. With Zeos 8.0 you also can use OLEDB and ODBC.

To use FreeTDS please set the LibraryLocation property of TZConnection to the full path of the library. Something like 'C:\Program Files\My Program\libsybdb-5.dll'.

Best regards,

Jan
Post Reply