Error "The connection cannot be used to perform this operation. It is either closed or invalid in this context."
Posted on 2007-11-15
ERROR "The connection cannot be used to perform this operation. It is either closed or invalid in this context.".
rs = New ADODB.Recordset
rs.CursorLocation = rs.CursorLocation.adUseClient
rs.CursorType = rs.CursorType.adOpenForwardOnly
If intMaxRecords > 0 Then
rs.MaxRecords = intMaxRecords
rs.StayInSync = False
rs.Open(strSQL, vConn.mDBConn, ADODB.CursorTypeEnum.adOpenStatic, rs.LockType.adLockOptimistic)
The VS.Net is giving me error at the last line. I have open the connection using ADODB interface.
I do not know what is happening. Please help