I am receiving an error message that I am not quite sure why.
In a constants module I have my connection string to an ADO-SQL Server 7 table, I have changed some details to protect the innocent.. please help.
Public Const myCostsConn As String = "Provider=SQLOLEDB;Initial Catalog=dbase;Data Source=server;User ID=userid;Password=password;"
In the procedure being called I have...
Sub btn_ChangeCostsData_Click()
Dim myADOConn As ADODB.Connection
Dim myADORs As ADODB.Recordset
Dim mySQL As String
Set myADOConn = New ADODB.Connection
Set myADORs = New ADODB.Recordset
mySQL = "Exec mySProc"
myADOConn.Open myCostsConn
myADORs.Open Source:=mySQL, ActiveConnection:=myADOConn
If Not (myADORs.BOF Or myADORs.EOF) Then
on the last line I get the debug error message ...
"Operation is not allowed when the object is closed."
MSDN tells me to check the state of the connection, but it is showing as open (1)
I just dont know, because even more strangely the code worked last night?
Any help greatly appreciated.
cheers
Matt
crazy times call for crazy people
CrazyPabs
Is it lunchtime yet?
In a constants module I have my connection string to an ADO-SQL Server 7 table, I have changed some details to protect the innocent.. please help.
Public Const myCostsConn As String = "Provider=SQLOLEDB;Initial Catalog=dbase;Data Source=server;User ID=userid;Password=password;"
In the procedure being called I have...
Sub btn_ChangeCostsData_Click()
Dim myADOConn As ADODB.Connection
Dim myADORs As ADODB.Recordset
Dim mySQL As String
Set myADOConn = New ADODB.Connection
Set myADORs = New ADODB.Recordset
mySQL = "Exec mySProc"
myADOConn.Open myCostsConn
myADORs.Open Source:=mySQL, ActiveConnection:=myADOConn
If Not (myADORs.BOF Or myADORs.EOF) Then
on the last line I get the debug error message ...
"Operation is not allowed when the object is closed."
MSDN tells me to check the state of the connection, but it is showing as open (1)
I just dont know, because even more strangely the code worked last night?
Any help greatly appreciated.
cheers
Matt
crazy times call for crazy people
CrazyPabs
Is it lunchtime yet?