Welcome to WebmasterWorld Guest from 18.104.22.168 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
How do I set a lock type and cursor on a RS that executes an sql str execute sql str and lock types midi25 msg:956520 6:39 pm on Jan 7, 2003 (gmt 0) 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.
Gizmare msg:956521 7:20 pm on Jan 7, 2003 (gmt 0)
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 msg:956522 7:32 pm on Jan 7, 2003 (gmt 0)
if you are talking about the adovbs.inc file then i know about that.
i just need to know the syntax.
aspdaddy msg:956523 8:44 pm on Jan 7, 2003 (gmt 0)
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 msg:956524 4:15 am on Jan 8, 2003 (gmt 0)
This should do
Set RS = server.CreateObject("ADODB.RECORDSET")
RS.CursorLocation = adUseClient RS.CursorType = adOpenStatic RS.LockType = adLockPessimistic RS.Open DBConnection.Execute(SQLStatement) midi25 msg:956525 1:52 pm on Jan 8, 2003 (gmt 0)
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.