I've a DataGrid Control in my application and a button. When i click a button it should display the contents of the Logins table in the DataGrid. For this I've coded the following, but its giving me an error "Rowset is not bookmarkable.". I've searched a lot, many suggestions include changing Recordset cursor type and cursor location. But those suggestions don't solve my problem..
thanks..!!
My Code ::
Private Sub OpenConnection()
Set dbConnection = New ADODB.Connection
dbConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & "G:\ShopManProject\" & "dbShopMan.mdb"
dbConnection.Open
Set dbCommand = New ADODB.Command
Set dbCommand.ActiveConnection = dbConnection
dbCommand.CommandType = adCmdText
End Sub
Private Sub Command5_Click()
OpenConnection
dbCommand.CommandText = "select * from Logins"
Set dbRecordset = New ADODB.Recordset
dbRecordset.CursorLocation = adUseClient
dbRecordset.CursorType = adOpenKeyset
dbRecordset.LockType = adLockOptimistic
Set dbRecordset = dbCommand.Execute
Set dataGridItems.DataSource = dbRecordset
End Sub