homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

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)

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)

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)

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)

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)

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)

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved