|
|
|
|
|
| | |
|
Active Server Pages ASP programs help tutorial tutorials routine routines jobs listserve mailinglist bulletin board bulletin boards programming snippet snippets CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: recordset locking? |
From: |
kal |
Date: |
10/18/1999 1:48:45 PM |
IP: |
131.107.3.73 |
May be this will help.
<%
Set rs = Server.CreateObject("ADODB.RecordSet")
Set rs1 = Server.CreateObject("ADODB.RecordSet")
rs.ActiveConnection = objconn
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
sql="SELECT key FROM getkey WHERE table = hello"
rs.Open sql
UserID = rs("key")
NewKey = CInt(rs("key")) + 1
rs1.ActiveConnection = objconn
rs1.CursorType = adOpenKeyset
rs1.LockType = adLockOptimistic
SQL = "UPDATE getkey SET key = " & NewKey & " WHERE table=hello"
rs1.Open sql
%>
for this you have to include the adovbs.inc file. Search for this file in your hard drive. I think this file gets added when you install vb.
Here the locktype has 4 values. They are:
adLockReadOnly
Default. Read-only—you cannot alter the data.
adLockPessimistic
Pessimistic locking, record by record—the provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately upon editing.
adLockOptimistic
Optimistic locking, record by record—the provider uses optimistic locking, locking records only when you call the Update method.
adLockBatchOptimistic
Optimistic batch updates—required for batch update mode as opposed to immediate update mode.
Kal
|
Previous Message
|
|

|
|
|
|
|
|
|
|
|
|