Welcome to WebmasterWorld Guest from 23.20.10.127

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)

Junior Member

10+ Year Member

joined:Apr 30, 2002
posts:198
votes: 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.

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

Junior Member

10+ Year Member

joined:Sept 16, 2002
posts:70
votes: 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.
7:32 pm on Jan 7, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 30, 2002
posts:198
votes: 0


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 13, 2002
posts:2162
votes: 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

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

Preferred Member

10+ Year Member

joined:Oct 28, 2002
posts:506
votes: 0


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)

Junior Member

10+ Year Member

joined:Apr 30, 2002
posts:198
votes: 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.

Thanks All

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members