title: vb6 ADODB connection string to sql server 2008
body: <p>I recently migrated a database from sql server 2005 to 2008 on windows server 2008.  Clients connect fine from their XP machines and so does the SQL Management Studio 2008.  I have also tested a remote connection using LINQPad which worked fine.  </p>
  
  <p>However on my VB6 app, the connection string seems to give me problems.  Any ideas what I'm doing wrong? </p>
  
  <pre><code>    Dim strUserName As String
       Dim strPassword As String
       Dim sProc As String
  
       sProc = "Class_clsAdoFnx_Initialize"
  
          Me.DatabaseName = "db_app"
  
  
  
  
   'Connect to SQL Server
  
      strUserName = "admin"
      strPassword = "mudslinger"
  
      Set cSQLConn = New ADODB.Connection
      '**Original connection String
      'cSQLConn.CommandTimeout = 0
      'cSQLConn.ConnectionString = " PROVIDER=SQLOLEDB" &amp; _
      '    ";SERVER=NET-BRAIN" &amp; _
      '    ";UID=" &amp; strUserName &amp; _
      '    ";PWD=" &amp; strPassword &amp; _
      '    ";DATABASE=" &amp; Me.DatabaseName
  
      '***First attempt, no dice
      'cSQLConn.ConnectionString = "Provider=sqloledb;" &amp; _
      '       "Data Source=NET-BRAIN;" &amp; _
      '       "Initial Catalog=DB_APP;" &amp; _
      '       "User Id=admin;" &amp; _
      '       "Password=mudslinger"
      'cSQLConn.Open
  
      '***3rd attempt, no dice 
      cSQLConn.Open "Provider=sqloledb;" &amp; _
             "Data Source=NET-BRAIN;" &amp; _
             "Initial Catalog=db_app;" &amp; _
             "User Id=admin;" &amp; _
             "Password=mudslinger", "admin", "mudslinger"
  </code></pre>
  
  <p>thanks in advance.</p>
  
  <p>UPDATE: Here is the string I generated using my test.UL file</p>
  
  <p><strong>[ODBC] Provider</strong></p>
  
  <p>Provider=MSDASQL.1;Password=logmein;Persist Security Info=True;User ID=sa;Extended Properties="DSN=NET-BRAIN;UID=admin;PWD=mudslinger;APP=Microsoft® Windows® Operating System;WSID=BPOOR-16D68FBC7D;DATABASE=DB_App;Network=DBMSSOCN";Initial Catalog=DB_App</p>
  
  <p>Here is the same UL file using the <strong>SQL Native provider</strong>: </p>
  
  <p>"Provider=SQLNCLI10.1;Integrated Security="";Persist Security Info=False;User ID=admin;Initial Catalog=DB_APP;Data Source=NET-BRAIN;Initial File Name="";Server SPN="""</p>
  
  <p>--received the error: Error in Ado Call... There was an error in Class_clasAdoFnx_initialize 3001 Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
  --Error: Class_clsAdoFnx_Initialize 
  3709 Requested operation requires an OLE DB Session object, which is not supported by current provider. </p>
  
  <p><strong>tried [oledb] for sql server provider option</strong> 
  "Provider=SQLOLEDB.1;Password=mudslinger;Persist Security Info=True;User ID=admin;Initial Catalog=db_app;Data Source=net-brain"</p>
  
  <p>error: -2147217900 Login failed for user 'admin' </p>
  
  <p><strong>UPDATE2 :</strong> After isolating the open connection string, it turns out the connection is opening and the stored procedure I was using to test with was failing. </p>