Connecting to SQL server using SQL Client and DSN - sql-server

Would it be possible to connect to SQL server using DSN however using SqlClient rather than ODBC.
As a matter of fact we have to upgrade a legacy VB6 component however we have to keep the user suitability same ie the users are connecting to database using a DSN.
I would like to avoid ODBC if it would be possible to connect using SqlClient.
Any comments, examples would be appreciated.
ta

Basically the answer is no. Either use ODBC or OLEDB.

Related

SQL server linked server to SAS(Statistical Analysis System)?

has anyone ever been able to create a sql server linked server to SAS?
I have created an ODBC connection (32bit) to SAS
This ODBC works for e.g. QlikView, Tableau etc.. but how would set it up for SQL server?
Provider?
Product name?
Data Source?
Location?
Catalog?
If the DSN is already created, you can access it in SAS directly using:
libname myServer odbc dsn=PROD_PL0000 schema='dbo';
Then you'll see it as a SAS library that you can work with natively. If you do it via the GUI you can check a box to have it reconnect at start up.
I also have the same problem. The problem is in the SAS provider for OLE DB connections, it can't create a popular instance with SAS tables.
To create the linked server via OLE DB you need to go to the SAS website, download the files and install on the SQL server to set up the connection.
https://support.sas.com/downloads/package.htm?pid=648

How to connect to SQL Server?

I use SQL Server 2008 R2 and SQL Server 2012 with C#, but I wonder how can I connect to them using D...
I did a google search and found this: http://www.prowiki.org/wiki4d/wiki.cgi?DatabaseBindings
But I found nothing about connecting to SQL Server...
One option is to use the OpenDBX bindings available here: https://github.com/rikkimax/Derelict_Extras---OpenDBX. OpenDBX provides access to multiple db servers , using a unified interface, including MS SQL Server, PostgreSQL, SQLite and others.
It has a C api so it is not very pretty, but it should work.
Another option is to use ODBC. Bindings are available at https://github.com/AndrejMitrovic/DWinProgramming.
I suggest you write a binding/wrapper for FreeTDS: http://www.freetds.org/ . That is the best, open-source library you can use to connect to the SQL server. An alternative would perhaps be unixODBC and iODBC, but as far as I know they both use FreeTDS for Microsoft SQL Server.

Which ODBC driver should I use for SQL Server?

There is a param on ODBC connection strings called Driver.
My old application always used {SQL Driver} and I know there is {SQL Native Client} and others.
My questions are:
What is the difference between these types of Drivers?
When do I should use one or another?
I'm not defining a Provider on my connection. Should I?
What is the best way to configure my connection string?
I'm using SQL Server 2005 Standard

Connection is busy with results for another hstmt in delphi

i have developed a application in Delphi using Paradox and bde , now am migrating it into sql server 2008,
i have a lot of table and query components in every form, so am just create user DNS in ODBC manager with 'Sql Server - Driver' , and configure with BDE(connect sql server via BDE),
The problem is , while am working in some form, the error raised like
Connection is busy with results for another hstmt
Am tried with Sql native clinet , but i gives lot of troubles for me, so am using sql-server driver,
please any one help me to fix this problem, or give a steps to migrate paradox to sql server wihtout using 3rd party componets and ado,,,,
Try to set MARS_Connection=yes for your DSN.
SQL Server Driver has few issues when it works with SQL Server 2008. So, consider to use SQL Native Client 10.

Connecting to SQL Server using Delphi and dbExpress

I use RAD Studio 2010 including latest updates 4 and 5, my database is SQL Server Express.
I set up a TSQLConnection but it won't connect, error message is "DBX-Error: the driver could not be initialized correctly. A client library may be missing, may not be installed correctly, or may have the wrong version" (error messagetranslated from German).
Connecting to the database via TADOConnection works fine with both ADO drivers ("Microsoft OLE DB Provider for SQL Server" and "SQL Native Client").
Can anybody give me a hint how to connect via dbExpress?
you need to install the sql native client, if you read the read me that comes with RAD studio 2010 its says that it is a requirement for connecting to sql server 2000/2005/2008
I’ve also discovered that in dbxdrivers.ini they haven’t added the proper option for MSSQL 2000/2005 you need to edit the top bit to add in MSSQL9=1
example:
[Installed Drivers]
DBXTrace=1
DBXPool=1
BlackfishSQL=1
DataSnap=1
ASA=1
ASE=1
DB2=1
Firebird=1
Informix=1
Interbase=1
MSSQL=1
MSSQL9=1
MySQL=1
Oracle=1
you can then select MSSQL9 as a dbExpress option and it should also appear in data explorer as well
I had a similiar issue with Delphi XE2 ad SQL Server 2005. I uninstalled and installed several versions (including MSSQL 2008 R2) of SQL Native Client to no avail. But adding MSSQL9=1 to the ini file worked.
Maybe this thread on the EDN (Embarcadero Developer Network) can be helpful.

Resources