Help! Operation is not allowed in this context

R

ronaldlee

Hi, I got an error message - Operation is not allowed in this context.
It said the error comes from the line objRS.Close()
Anyone have any ideas why? Thanks a lot.

Here is part of the code:

Dim strConnectionString As String =
"PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=c:\test.mdb"
objConn = New ADODB.Connection
objConn.Open(strConnectionString)
objRS = New ADODB.Recordset
objRS.ActiveConnection = oCn
objRS.LockType = ADODB.LockTypeEnum.adLockOptimistic
objRS.CursorType = ADODB.CursorTypeEnum.adOpenDynamic
objRS.Open("SELECT * FROM Customers WHERE CustomerID = " &
Session("CustomerID"), objConn)

' DO SOMETHING HERE'

objRS.Close()

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top