I was starting to think I was an idiot - but after researching this, I find many people have had this problem, and few have any helpful comments on a solution, so I'll try here.......

The following code runs beautifully on my test environment - however, as soon as I load it onto the network to access the SQL server, I get the blasted - error 2147217887 - "Data Provider could not be initialized"

I'm dying here - does anyone know how to resolve this problem?????



Function SetFloaterDataSource()

Dim RecSourceFloater As String
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

RecSourceFloater = "SELECT tbl_UserVarHSTUFloatStatByEelink.* " _
& "From tbl_UserVarHSTUFloatStatByEelink " _
& "WHERE (((tbl_UserVarHSTUFloatStatByEelink.idCalendar)=" & MyTSCalcIdCal & "));"

Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Access.OLEDB.10.0"
.Properties("Data Provider").Value = "SQLOLEDB"
.Properties("Data Source").Value = "SOS-1"
.Properties("Integrated Security").Value = "SSPI"
.Properties("Initial Catalog").Value = "TIMS"
End With

'Create an instance of the ADO Recordset class, and
'set its properties
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = RecSourceFloater
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
End With

'Set the form's Recordset property to the ADO recordset
Set WeekDay.Form.Recordset = rs

Set rs = Nothing
Set cn = Nothing

End Function