Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When opening a recordset, I want to

Status
Not open for further replies.

Chopstik

Technical User
Oct 24, 2001
2,180
US
When opening a recordset, I want to open it with CursorType = adOpenKeyset, LockType = adLockOptimistic. However, the setup here (for some reason, I don't know why, but if someone can tell me that too, that would be great) doesn't allow me to actually use this terminology. Instead, I am forced to use the numerical equivalents, and I just realised I may not be using the correct ones. Can someone give me a breakdown?

For example, is LockType = 3 the same as LockType = adLockOptimistic? Thanks!
 
You need to look in file adovbs.inc which will be ion your PC somewhere

the value you are after are


'---- LockTypeEnum Values ----


Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3
Const adLockBatchOptimistic = 4

Andy
 
That is precisely what I was looking for. Thanks!
 
This file contains the VB constants so you can reference in your program.
<!-- METADATA TYPE=&quot;typelib&quot;
FILE=&quot;C:\Program Files\Common Files\System\ado\msado15.dll&quot; -->

Should be the first line in your ASP.
 
Oh, so you have to reference the .dll file in the asp in order to be able to use the names as opposed to the numeric equivalents? Would this come before or after (or does it make a difference?) any include statements?
 
Correct.

Here is an example - it is the first line or at least that is my understanding, but you can experiment if you want.
<!-- METADATA TYPE=&quot;typelib&quot;
FILE=&quot;C:\Program Files\Common Files\System\ado\msado15.dll&quot; -->
<!-- #include file=&quot;ConnectInclude.asp&quot; -->
<!-- #include file=&quot;ResultSetFormat.asp&quot; -->
 
Or you can use an include virtual statement pointing to the adovbs.inc file.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top