Solved

ODBC Connecion string for MSSQL 2010 server  using DSN

Posted on 2013-06-23
9
485 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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 69

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

756 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