Cant set recordset locktype

Results 1 to 2 of 2

Thread: Cant set recordset locktype

  1. #1
    Join Date
    Dec 1969

    Default Cant set recordset locktype

    Hi All,<BR><BR>I&#039m trying to learn ASP and have hit a wall. The following section of code generates an error when I try to set the locktype:<BR><BR>dim rs, conn<BR>set conn = server.createobject("adodb.connection")<BR>set rs = server.createobject("adodb.recordset")<BR>conn.ope n "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\wks-monitordbAssetTracking.mdb;Mode=ReadWrite&#124Shar e Deny None;Persist Security Info=False","Admin"<BR>rs.cursortype=asOpenKeySet< BR>rs.locktype=adLockoptimistic<BR>rs.Open "SELECT * FROM Assets WHERE EmployeeID = 1",conn<BR><BR>The error I get is:<BR>ADODB.Recordset (0x800A0BB9)<BR>Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. On the rs.locktype line.<BR><BR>After a couple of hours of pure frustration I tried copying the code into VB6 as such and it worked fine!<BR><BR><BR>Dim rs As New ADODB.Recordset<BR>Dim conn As New ADODB.connection<BR><BR>conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\wks-monitordbAssetTracking.mdb;Mode=ReadWrite&#124Shar e Deny None;Persist Security Info=False", "Admin"<BR>rs.cursortype = adOpenKeyset<BR>rs.locktype = adLockOptimistic<BR>rs.Open "SELECT * FROM Assets WHERE EmployeeID = 1", conn<BR><BR>The only manner in which I can connect to the database using the ASP code is ReadOnly. I loosened security on the server to have everyone fullcontrol.<BR><BR>Any Ideas,<BR>Steve

  2. #2 Guest

    Default RE: Cant set recordset locktype

    The reason it works in VB and not in VBS is that vbs is a cut-down version of vb and does not have all the things VB has. This includes the builtin constants like "adOpenKeyset". There is a file "", which can be downloaded. You put it into your ASP file as an include, and it sets all those constants. Alternatively, you find the numbers for all the constants you use and use numbers instead of constant names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts