Need to connect SQL server 2005 WITH vb6.

SQL Express connection string for vb6.

Need to connect SQL Server2005 with VB6

i have below code..

i have to change Username and password to open the software. but it is in windows authentication to open,

Public Sub OpenConn()
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

Kindly help me with the code to connect sql server with vb6

0 answers