radubalmus
Programmer
Hello all
I get the above error tring to create a new entry in an sql database. I am using an excel frontend with ADO connection. This happens since we have upgraded excel from 2003 to 2010
The error happens on MyRecordset.Open
this is the code:
Dim MyConnection As ADODB.Connection
Dim MyRecordset As ADODB.Recordset
Dim sqlConnString As String
sqlConnString = "Driver={SQL Server};Server=xx.xx.x.xx;Database=erotestdb;Uid=xxx;Pwd=xxx;APP=Microsoft Office 2003"Set MyConnection = CreateObject("ADODB.Connection")
Set MyRecordset = CreateObject("ADODB.Recordset")
With MyConnection
.ConnectionString = sqlConnString
'On Error Resume Next
If Err.Number <> 0 Then
MsgBox "SQLServer Connection could not be established."
Err.Clear
'On Error GoTo 0
'blnOffline = True
'GoTo ClearMem
End If
.Open
End With
MyRecordset.Open table, MyConnection, adOpenKeyset, adLockOptimistic
Set getRS = MyRecordset
Any ideea?
Thanks
There are simple solutions for almost every problem! The hard part is to see them!!!!
I get the above error tring to create a new entry in an sql database. I am using an excel frontend with ADO connection. This happens since we have upgraded excel from 2003 to 2010
The error happens on MyRecordset.Open
this is the code:
Dim MyConnection As ADODB.Connection
Dim MyRecordset As ADODB.Recordset
Dim sqlConnString As String
sqlConnString = "Driver={SQL Server};Server=xx.xx.x.xx;Database=erotestdb;Uid=xxx;Pwd=xxx;APP=Microsoft Office 2003"Set MyConnection = CreateObject("ADODB.Connection")
Set MyRecordset = CreateObject("ADODB.Recordset")
With MyConnection
.ConnectionString = sqlConnString
'On Error Resume Next
If Err.Number <> 0 Then
MsgBox "SQLServer Connection could not be established."
Err.Clear
'On Error GoTo 0
'blnOffline = True
'GoTo ClearMem
End If
.Open
End With
MyRecordset.Open table, MyConnection, adOpenKeyset, adLockOptimistic
Set getRS = MyRecordset
Any ideea?
Thanks
There are simple solutions for almost every problem! The hard part is to see them!!!!