Welcome to WebmasterWorld Guest from 54.162.141.212

Forum Moderators: ocean10000

Message Too Old, No Replies

How do I set a lock type and cursor on a RS that executes an sql str

execute sql str and lock types

     
6:39 pm on Jan 7, 2003 (gmt 0)

10+ Year Member



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.

7:20 pm on Jan 7, 2003 (gmt 0)

10+ Year Member



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.
7:32 pm on Jan 7, 2003 (gmt 0)

10+ Year Member



if you are talking about the adovbs.inc file then i know about that.

i just need to know the syntax.

8:44 pm on Jan 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

4:15 am on Jan 8, 2003 (gmt 0)

10+ Year Member



This should do

Set RS = server.CreateObject("ADODB.RECORDSET")
RS.CursorLocation = adUseClient
RS.CursorType = adOpenStatic
RS.LockType = adLockPessimistic
RS.Open DBConnection.Execute(SQLStatement)

1:52 pm on Jan 8, 2003 (gmt 0)

10+ Year Member



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.

Thanks All

 

Featured Threads

Hot Threads This Week

Hot Threads This Month