Hi all,

I was wondering is someone could help me on this. I have a VB script with
the following code to create a connection to a MS access database. Is there
a way I can make a connection to a SQL server database without changing the
entire script.

The code below is the current code to the access database and works fine. I
would just like to now connect it sql.


Sub subConnectionOpen
Set objCon = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")
sProviderName = "Microsoft.Jet.OLEDB.4.0"
iCursorType = 1
iLockType = 3
sDataSource = "MitInventory.mdb"
objCon.Provider = sProviderName
objCon.Properties("Data Source") = sDataSource
objCon.Open
End Sub

Thanks in advance
Dave.