Forum Moderators: open

Message Too Old, No Replies

question about sql connection string

SQL Server 2000 recordsets

         

crashomon

2:15 pm on May 25, 2005 (gmt 0)

10+ Year Member



Hi, I inherited some code from another person and was curious about this line:
rs.Open "select * from myDatabase",conn,1,3

I know it means "open recordset and select all from my database" but I'm not sure what the 1 and the 3 are after the conn. Is there a specific term for these numbers?

any clues? And what are some other numbers that might be used here?

Thanks in advance,

Patrick
SQL Server 2000 newbie

mrMister

2:31 pm on May 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The first number is the cursor type, the second number is the lock type.

1 is adOpenKeyset
3 is adLockOptimistic

Posible values for cursor types:

[msdn.microsoft.com...]

Possible values for lock types:

[msdn.microsoft.com...]

I wouldn't change them if I were you. The previous programmer would have chosen those lock and cursor types for a reason.

crashomon

2:37 pm on May 25, 2005 (gmt 0)

10+ Year Member



excellent! That is exactly what I needed. I won't be changing them, but in my attempts to reverse engineer this site, I've done changes to the elements where necessary, but now that I know that this is, I know to leave these alone.

Muchos Gracias.

Patrick

mrMister

2:43 pm on May 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might want to change the numbers to ADOVBS constants to make the code easier to read.

There's two ways of doing this. One is to include adovbs.inc in all of your data pages...

Here's a guide to adovbs.inc

[asp101.com...]

The other (and better) way of doing it is to import the ADO type library in your global.asa file...

To do this just place the floowing code at the top of your global.asa file (create a blank one if you don't have one already and place it in your webroot)

<!--METADATA
TYPE="TypeLib"
NAME="Microsoft ActiveX Data Objects 2.6 Library"
UUID="{00000206-0000-0010-8000-00AA006D2EA4}"
VERSION="2.6"
-->