Solved

ODBC Connecion string for MSSQL 2010 server  using DSN

Posted on 2013-06-23
9
497 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
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 
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 70

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

635 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