Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 using ODBC data source to connect to SQL 2012

Author  Topic 

sheekom
Starting Member

1 Post

Posted - 2012-08-08 : 16:52:20
I am trying to connect using ODBC Data source to my SQL server 2012 database using the following string
Provider=SQLNCLI11;Server=SQLSERVER2012;Data Source=omsGUAS;Integrated Security=SSPI;User ID=sa;pwd=Naina2010;DataTypeCompatibility=80;MARS Connection=False;

and it does not work from Excel VBA while I have tested the ODBC connection using ODBC connection wizard. I get "can not connect to SQL server error". However, if I replace the Database name instead of ODBC Database name, it works as follows:

Provider=SQLNCLI11;Server=SQLSERVER2012;Database=omsGUAS_OMS;Integrated Security=SSPI;User ID=sa;pwd=Naina2010;DataTypeCompatibility=80;MARS Connection=True;

What am I missing here. First string used to work with SQL 2000 and I have migrated the database successfully to SQL 2012 in 2 phase steps.
Any help and/or suggestion would be appreciated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-08-08 : 17:32:31
This applies to 2012 too: http://www.connectionstrings.com/sql-server-2008

You are mixing SQL and Windows authentication in your connection strings.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -