> Could anybody tell me please what the "1,2" refers to in the last
> line of this code and where I can get a list of the parts to this
> '.open' argument?
<snip>
> rsuser.open strsql,conn,1,2
> ~~~
> Thanks
>
> jon
Actually, a very important argument is missing: the 5th <options> argument,
where the command type and execution options are specified. The statement
should look like this:
rsuser.open strsql,conn,1,2, 1
The third argument (1) specifies the cursor type, with 1 corresponding to
adOpenKeyset, an expensive cursor type which is usually not needed in asp
code.
the 4th argument (2) specifies the lock type, with 2 corresponding to
adLockPessimistic - it is highly recommended that you do not use this
locktype in asp applications that need to support more than 2-3 users.
As said above, the 5th argument is used to specify the commandtype and
execute options. You should specify these rather than making ADO guess. It
will improve performance. My suggested argument, 1, corresponds to the
adCmdText command type, which is what should be used when passing a string
containing a sql statement to the database.
Your code will be better documented if you use the ADO constants rather than
the numbers. See http://www.aspfaq.com/show.asp?id=2112 for a good technique
to use to expose the ADO constants in your pages. Using constants, this line
of code would look like this:
rsuser.open strsql,conn,adOpenKeyset,adLockPessimistic, _
adCmdText
The benefit, of course, is that you don't have to look up what the numbers
mean.
Go here for the ADO documentation:
http://msdn.microsoft.com/library/en-us/ado270/htm/adostartpage1.asp
For your specific question, see here:
http://msdn.microsoft.com/library/en-us/ado270/htm/mdamth03_2.asp
HTH,
Bob Barrows
these are ado constants
http://www.aspin.com/func/search?cob=aspkey&qry=ADO+constants