Solved

ODBC Connecion string for MSSQL 2010 server  using DSN

Posted on 2013-06-23
9
480 Views
Last Modified: 2013-07-02
Hello,
I have successfully set up ODBC connection strings from my C# application to a DB2 database and to excel spreadsheet using DSN

DB2 connection string= "DSN=MyDSNname; UID=Myname; PWD=Mypassword;"

EXCEL Connection string = "DSN= MyDSNName; Data Source=C:\MySpreadSheet.xls; HDR=yes; Format=xls;"

I now need to create an ODBC connection to a MS SQL 2010 database using a DSN. Can anyone please tell me the format of this connection string ?

regards
Pat
0
Comment
Question by:pclarke7
9 Comments
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 100 total points
ID: 39269497
If you're writing code in C#, why would you want to use DSN? You'd have to set it up on each machine that runs your application.

Connection strings for SQL Server can be found here:  http://www.connectionstrings.com/
0
 
LVL 4

Assisted Solution

by:BAKADY
BAKADY earned 200 total points
ID: 39269498
ODBC Connections for all Databases here:

http://connectionstrings.com/

it's like MS SQL 2008

Regards
0
 

Author Comment

by:pclarke7
ID: 39269579
Thanks for your inputs. I have gone to connectionstrings.com but there doesn't seem to be any examples under 2008 using DSN.  They are all looking at supplying the server address like the example below:

Server=myServerAddress;Database=myDataBase;User Id=myUsername; Password=myPassword;

I have set up an ODBC data source and would like to connect through this.

regards
Pat
-
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
ID: 39269638
You might want to look at this page: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/9d7799a3-2850-43ce-acea-2a43cbe20c9d/dsn-with-sqlconnection  Using a DSN may be possible but it is not the preferred method with SQL Server.  SQL Native Client is the driver that provides all the connections anyway, both ODBC and OLEDB.
0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 100 total points
ID: 39269902
If you use ODBC, be aware that you won't get full support - that is you can't use e.g. several new datatypes and extended features.
0
 
LVL 4

Accepted Solution

by:
BAKADY earned 200 total points
ID: 39270451
0
 

Author Comment

by:pclarke7
ID: 39290818
Whilst I appreciate the input of all of those who gave answers, none of the answers gave me what I was looking for. I am still unable to like to MS SQL via ODBC. I have changed over to native SQL. But at the end of the day I did not get the answers that I was looking for.

regards
 Pat
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now