SQL Server Connection Method

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MattRink
Posts: 3
Joined: Wed 26 Jun 2013 10:07

SQL Server Connection Method

Post by MattRink » Tue 15 Oct 2013 11:05

I know that UniDAC uses several different methods to connect to a SQL Server database, depending on what is available. Is it possible via UniDAC to determine what connection method is used to connect to an SQL Server database.

What I want to do is detect if the native client is being used and if not display a message informing the user to install the native client. Is this possible?

Thanks,
Matt

AndreyZ

Re: SQL Server Connection Method

Post by AndreyZ » Tue 15 Oct 2013 13:53

To work with SQL Server, UniDAC uses either OLEDB or SQL Native Client provider. To make UniDAC use the SQL Native Client provider only, you should set the OLEDBProvider specific option to prNativeClient. Here is a code example:

Code: Select all

UniConnection.SpecificOptions.Values['OLEDBProvider'] := 'prNativeClient';
In this case, if there is no SQL Native Client provider installed on a computer, the "Required provider is not installed" error is generated.

Post Reply