Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why do I get "rowset not bookmarable" here? 1

Status
Not open for further replies.
May 22, 2002
6
0
0
NO
Hello,

Anyone out there who can tell me why I get the run-time error '7004': "The rowset is not bookmarable" when I am running this programcode?

The wole thing stops when the program attemting to put the data out in the dataGrid dgrTest.

Option Explicit
Private objConn As ADODB.Connection
Private mrsProdName As New Recordset
Const tmpProdNo = 33037

Private Sub OpenConnection()
Set objConn = New ADODB.Connection
objConn.ConnectionString = "PROVIDER=MSDASQL;DSN=Testdsn;UID=sa;Password=test;"
objConn.Open
End Sub


Private Sub GetInfo()
Dim strSQL As String
strSQL = "SELECT ProdNo, ProdName, AltProdno, ProdGroup " _
& "From dekl_MovexProd " _
& "Where ProdNo = " & tmpProdNo
OpenConnection
mrsProdName.Open strSQL, objConn
Set dgrTest.DataSource = mrsProdName
End Sub



Private Sub CloseConnection()
If Not (mrsProdName Is Nothing) Then
Set mrsProdName = Nothing
End If
If Not (objConn Is Nothing) Then
objConn.Close
Set objConn = Nothing
End If
End Sub


Best regard LearningVB (or still LearningVB)
 
There are a couple of things that you may want to try. Explicitly indicate the type of Recorset.

Private mrsProdName As New ADODB.Recordset to avoid a possible conflict with a DAO Recorset.

You might also try different settings for the CursorType and CursorLocation properties

mrsProdName .CursorType = adOpenStatic
mrsProdName .CursorLocation = adUseClient

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
TO add Cajun
yes its the problem of Recordset Type actually by default the Recordset opens in ForwardOnly Mode which not support too many things although its the fastest method to retrieve the rows ..jsut try as Cajun mentioned
mrsProdName .CursorType = adOpenStatic 'or adOpenKeySet
mrsProdName .CursorLocation = adUseClient

Regarda
Nouman


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top