Hi Jon, till now I didn't realize that bookmarks weren't supported on adOpenDynamic cursors. You're right: "Strangely enough"! I can' t see another solution than to omit the use of bookmarks and instead work it around with Recordset.AbsolutePosition. (Held and set it in a long variable.)
A month ago I started to write an addin for Access2000/XP. It's still work in progress. But you might find it helpful as it is: http://www.moss-soft.de/public/sapdb/SAP.zip (Export of tables is found in frmTables). Ciao, Sascha > Howdy Sascha, > According to the component checker, I'm using MDAC 2.7 SP1 which I believe > is the latest. If I use adOpenDynamic I get an error that the recordset does > not support Bookmarks, so I use adOpenStatic. Strangely enough, though > you've suggested I use adUseServer, I found that I don't get the error if I > use adClient on the connection. In the end it looks like I might have to > use various connections based on what I want to do. On the recordsets that > don't use bookmarks, adUseServer on the Connection and adOpenDynamic on the > recordset seems to work best, whereas on the ones that use recordsets, > adUseClient on the Connection and adOpenStatic on the recordset seems to be > working for now. Wouldn't it be nice if all of the above combinations > worked? > Here's a quick VB project sample that creates the problem on my system: > > 'This is an example of a project that creates an error. I've distilled out > the actions that seem to lead up to > 'the error, and is obviously not the actual code. The use of Bookmarks stems > from using Infragistics Datagrid. I use this > 'control extensively in my apps and their controls rely heavily on the use > of bookmarks, so I'm left with limited options in > 'what I can do. > > Dim varBM(50) As Variant 'array will hold the bookmarks > Private Sub cmdRun_Click() > Dim strSQL As String > Dim i As Long > Dim j As Long > Dim rsS As New ADODB.Recordset > Dim cnS As New ADODB.Connection > > cnS.CursorLocation = adUseServer > cnS.Open "DSN=SAPDBTst1;Password=jono;User ID=OCPC;" 'I open the > connection to the DB here > strSQL = "select * from tblProjAO where ProjID = 8329 order by ProjAO " > 'tblProjAO has 6 fields, 4 integer, 2 boolean. ProjAO is the primary key, > integer default serial > rsS.Open strSQL, cnS, adOpenStatic, adLockOptimistic 'opens the > recordset. In this case there's 9 records > i = 1 > Do While Not rsS.EOF 'loops through the recordset > varBM(i) = rsS.Bookmark 'I gather up the bookmarks > i = i + 1 > rsS.MoveNext > Loop > rsS.Bookmark = varBM(2) 'successfully moves to the 2nd record in the set > rsS.MovePrevious 'successfully moves back one record. > rsS.MovePrevious 'hits BOF. BOF = true > rsS.Bookmark = varBM(1) 'successfully moves to the 1st record. BOF & EOF > false > rsS.MoveNext '<--- ERROR -2147217887 Multiple-step OLE DB operation > generated errors. Check each OLE DB status value, if available. No work was > done. > > 'I never get to this part > MsgBox "Done" > rsS.Close > Set rsS = Nothing > cnS.Close > Set cnS = Nothing > > End Sub > > > > > "Sascha Trowitzsch" <[EMAIL PROTECTED]> wrote in message > b1aqgr$2uh$[EMAIL PROTECTED]">news:b1aqgr$2uh$[EMAIL PROTECTED]... > > Hi Jon, > > > > which version of MDAC do you use? > > What cursor type do you use on opening the recordset? > > I've encountered problems when using adOpenKeyset. The only working thing > > seems to be adOpenDynamic. > > > > Cioa, Sascha _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
