Bookmarkable recordset from Access query 
Author Message
 Bookmarkable recordset from Access query

I'm using MS Access 2000 DB, ADO 2.6 in VB 6.0 SP5.

I want to set the datasource of a DataGrid equal to a
recordset (which I believe must be BookMarkable and client
side).  Using the Execute method of the Command or
Connection object doesn't seem to return bookmarkable
recordsets.  How do I work around this?


My code:
Const conQueryName As String = "qryOccurList2"
Dim lngAffectedRecs As Long
Dim cmn As ADODB.Command
Dim rst As ADODB.Recordset

Set cmn = New ADODB.Command
cmn.ActiveConnection = cn
cmn.CommandText = conQueryName

Set rst = New ADODB.Recordset
rst.CursorLocation = adUseClient
rst.CursorType = adOpenStatic
rst.LockType = adLockOptimistic
Set rst = cmn.Execute(lngAffectedRecs, , adCmdStoredProc)
Debug.Print rst.Supports(adBookmark) & " - Bookmark"

Thu, 02 Sep 2004 10:31:08 GMT  
 Bookmarkable recordset from Access query
Hi Rob


Set madoCNN = New adodb.Connection
    madoCNN.ConnectionString = DBConnection & DBName


    Set madoCMD = New adodb.Command
    madoCMD.ActiveConnection = madoCNN
    madoCMD.CommandType = adCmdText
    madoCMD.CommandText = Query


    Set madoRST = New adodb.Recordset
    madoRST.CursorType = adOpenKeyset
    madoRST.LockType = adLockOptimistic
    madoRST.CursorLocation = adUseClient
    madoRST.Open madoCMD

'Set Grids datasource

    Set pDBgrid.DataSource = madoRST

Hope this works for you, it works for me


Thu, 02 Sep 2004 19:31:04 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Bookmarkable recordset from pass-through query?

2. What is a Bookmarkable recordset?

3. Recordset is not bookmarkable

4. Please help - "Recordset not bookmarkable"

5. "Recordset not bookmarkable"

6. Bookmarkable property of recordset

7. 3 Access Questions- Recordsets, Queries, and Constants

8. Open Access 2.0 query as recordset

9. Using DAO to open pre-defined Access queries - returned recordset bad

10. Recordset Continues to return Null when Query Works in Access 97

11. Data Access - Recordsets and Queries - ANYBODY

12. Passing parameters to Access query using Recordset.Open


Powered by phpBB® Forum Software