Hi All,
I am getting a 3705 Error "Operation is not allowed when the object is open" when I run the below code
I have MARS enabled in my connection string, so I should supposedly be able to open multiple recordsets and compare data in them simultaneously, which is what I am trying to accomplish.
The red aread is where my code halts and throws the error.
I am using VB6 with a SQLSERVER Express Database. Please let me know if you see an error or know why this error is happening.
Thanks to all for any help.
I am getting a 3705 Error "Operation is not allowed when the object is open" when I run the below code
Code:
...
conSQL.ConnectionString = "Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=C:\Program Files...\Data3.mdf; Database=Data3;Trusted_Connection=Yes;MARS_Connection=yes;"
conSQL.CursorLocation = adUseClient
conSQL.Open
...
With cmdNewOrders
.ActiveConnection = conSQL
.CommandText = "SELECT All.* FROM All, New WHERE New.[order-id] = All.[order-id];"
.CommandType = adCmdText
End With
With rsNewOrders
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open cmdNewOrders
End With
If rsNewOrders.EOF = False Then
rsNewOrders.MoveFirst
Do
...
With cmdSelBuyers
.ActiveConnection = conSQL
.CommandText = "SELECT Buyers.* FROM Buyers WHERE Buyers.Email = '" & buyerEmail & "';"
.CommandType = adCmdText
End With
With rsSelBuyers
[red].CursorType = adOpenStatic[/red]
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open cmdSelBuyers
End With
If rsSelBuyers.EOF = True Then
...
I have MARS enabled in my connection string, so I should supposedly be able to open multiple recordsets and compare data in them simultaneously, which is what I am trying to accomplish.
The red aread is where my code halts and throws the error.
I am using VB6 with a SQLSERVER Express Database. Please let me know if you see an error or know why this error is happening.
Thanks to all for any help.