Using: VB6 into SQL Server 7
Form has a Data Grid that I want to load from a recordset. In order to do this, the recordset must be bookmarkable. Because of the underlying table size, I want to use a Stored Procedure so that the work happens at the server. I have to drive it with a parameter (maybe 2 or 3 parameters).
This code creates a recordset, but it does not have the bookmark property, so I'm guessing it's opening as adOpenDynamic. Obviously, I want to open it as adOpenKeyset, but nothing I've tried has worked (and I think I've tried everything). If someone can give me proven code that works, I'll buy you a beer or two! Thanks.
Jeff Carlin
To test if it's bookmarkable, just do this:Code:Dim objCmd As ADODB.Command
Dim rsHist As New ADODB.Recordset
' initialize the Command object
Set objCmd = New ADODB.Command
With objCmd
.ActiveConnection = PROJ_DB
.CommandType = adCmdStoredProc
.CommandText = "sel_history_where_candno"
.Parameters.Refresh
.Parameters(1) = g_lCandNo
Set rsHist = .Execute
End With
Set objCmd = Nothing
Code:Debug.Print rsHist.Bookmark
