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

ADO Recordset Best Practices

Status
Not open for further replies.

mmcgon

Programmer
Jan 12, 2003
29
US
I've been using ADO in ASP scripts for a while and wanted to gather some opinions about the best cursors and locktypes to use when working with recordsets. I am using an OLEDB connection to SQL Server 2000.

It looks to me like this:

1. If using a recordset in record order: adOpenForwardOnly/ adOpenReadOnly

2. If you need to use rs.RecordCount: adOpenStatic/ adOpenReadOnly

3. To update, use the Connection Execute method if possible.

What if you really need to make updates to a recordset? adOpenStatic/ adLockOptimistic?

Thanks!
Michael McGonigal
 
hi Michael,

i tend to use pretty much what you've stated...i don't use recordset.update() much at all, in favor of #3

btw, i went to high school with someone by your name - are you from FL by any chance?


=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top