Welcome to WebmasterWorld Guest from 188.8.131.52 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
How do I set a lock type and cursor on a RS that executes an sql str execute sql str and lock types midi25
Hi when i want to be able to specify a lock type and scrollable cursor on my RS that executes an sql string.
objRS.Open strSQL, objConn
can i include the parameters adLockOptimistic and adOpenKeyset?
what would the syntax need to be?
Could someone please explain if I need to use cursors and locks if i am reading and writing to a database in SQL.
I am fairly new to ASP thanks.
Yes, but you need an include file that defines all of them. Sticky me your email address and I will send you the one I use. As far as using locks reading and writing to the database it depends on what type of reading and writing you are doing. midi25
if you are talking about the adovbs.inc file then i know about that.
i just need to know the syntax.
I'm not 100% :) but think the syntax is something like:
objRS.open , objConn, adOpenKeyset
objRS.CursorLocation = adLockOptimistic
Most of the time you wont need to specify any cursors or lock at all (you get a foward cursor by default), just use:
// best performance for insert/update
objConn.Execute strSQL ,,&H00000080
// select - creates rs implicitly
set objRS=objConn.Execute strSQL duckhunter
This should do
Set RS = server.CreateObject("ADODB.RECORDSET")
RS.CursorLocation = adUseClient RS.CursorType = adOpenStatic RS.LockType = adLockPessimistic RS.Open DBConnection.Execute(SQLStatement) midi25
Thanks guys. I will have found an article on this. It is similar to ducks method. I think I will use that as its easier to understand.