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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset and CursorType

Status
Not open for further replies.

loudandclear

Programmer
Oct 1, 2002
3
CA
Hi,

I am trying to return a recordset that will support bookmarks so I can use the paging properties (AbsolutePage, ...) But all can manage to get is a forwardonly cursor.

Here is the code:

Set adoRecSet = CreateObject("ADODB.RecordSet")
adoRecSet.CursorType = 3
adoRecSet.Open strSQL, adoConn

After the open, the cursortype is always back to 0 (forwardonly) no matter what value I give to it before.

The connection string is using an oledb for sql server provider.

Could someone please help ?

Thanks,

Chris
 
I think the problem may be that there are a few more arguments used by adoRecSet.Open() than you have listed, and therefore the default value is used.
Try adding the third argument to your call.
Code:
Set adoRecSet = CreateObject("ADODB.RecordSet")        
adoRecSet.Open strSQL, adoConn, 3

There are five arguments for the Open method.
source
connection
cursor type
lock type
options
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top