title: SQL express connection string FOR vb6
body: <p>Need to connect SQL server 2005 WITH vb6. </p>
  
  <p>i have below code..</p>
  
  <p>i have to change Username and password to open the software. 
  but it is in windows authentication to open, </p>
  
  <p>Public Sub OpenConn()</p>
  
  <pre><code>If Cn.State = 1 Then Cn.Close
  'sql 2000 sql authentication
  Cn.ConnectionString = "Provider=sqloledb; Data Source=Guru;Initial Catalog=eIntelliCabs;User Id=w[enter image description here][1]indowsusername;Password=windowsloginpassword;"
  'sql 2005 /2008 express windows authetication
  'Cn.ConnectionString = "Provider=sqloledb;Data Source=maity;Initial Catalog=eIntelliCabs;User Id=sa;Password=123;"    
  Cn.CursorLocation = adUseClient
  Cn.Open
  </code></pre>
  
  <p>Kindly help me with the code. </p>