Well, it depends.
If indeed all you're doing is read records, adOpenForwardOnly, adLockReadOnly is the best way to go. This creates a "firehose" cursor which is optimized to read results in a readonly, forward only manner. This means you must read the records in sequential order, one by one. So, once you have read record 2, you can't go back to record 1.
To add new records, you must use an updateable cursor as well. adOpenKeyset would work fine as it allows records to be added to the recordset.
Cursor location determines the place where the cursor lives. With a Server Side cursor, the "server" (that is, the database engine) takes care of scrolling. So, if you call MoveNext() 100 times to retrieve record 101, all you send over the wire is record 101.
With a client side cursor, scrolling takes place at the client. This means that *all* records are send to the client, even if you're not using them. If you call MoveNext() 100 times, you actually transfer 101 records from the "server" to the "client".
In ASP scenarios, I prefer direct SQL over the AddNew, Update etc methods of the recordset. Using these methods causes quite some overhead. Using the Execute method of the Connection object will perform better, and is, IMHO, easier to use:
Dim SQL
SQL = "INSERT INTO Client (Name, Address) VALUES('CustomerName', 'CustomerAddress')
MyConnection.Execute(SQL)
No need to figure out what cursor type you need to set, as you don't need them at all.
Check out the ADO guides for more information:
http://msdn.microsoft.com/library/de...ireference.asp
http://msdn.microsoft.com/library/de...ortypeenum.asp
http://msdn.microsoft.com/library/de...cationenum.asp
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to:
Mildred Pierce by
Sonic Youth (Track 8 from the album:
Goo)