Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Default Lock for RecordSet


Message #1 by rg1@h... on Mon, 16 Apr 2001 23:53:06
Hi.



What's the default type of lock for this recordset?



Dim cn						

Dim sSql						

Dim rs							



'Set up the connection to database

Set cn = server.CreateObject("ADODB.Connection")

cn.Open "DSN=MyDSN; uid=MyUID; pwd=MyPWD;"



'Create Recordset object 

Set rs = Server.CreateObject("ADODB.Recordset")

Set rs.ActiveConnection = cn



'Check to see if record already exists

sSql = "sGROUPUSERSelect"

sSql = sSql & "'" & iUserID & "', " & "'" 		

Set rs = cn.Execute(sSql)



TIA.



Rita

Message #2 by "Hariharan" <hariharan_m2001@r...> on Tue, 17 Apr 2001 08:09:27
Hi Rita,

 

  Set rs = cn.Execute(sSql)



  When u open such a type of recorset then the returned Recordset object 

is always a read-only, forward-only cursor.



If you need a Recordset object with more functionality, first create a 

Recordset object with the desired property settings, then use the 

Recordset object's Open method to execute the query and return the desired 

cursor type





Regards,

Hari



> Hi.

> 

> What's the default type of lock for this recordset?

> 

> Dim cn						

> Dim sSql						

> Dim rs							

> 

> 'Set up the connection to database

> Set cn = server.CreateObject("ADODB.Connection")

> cn.Open "DSN=MyDSN; uid=MyUID; pwd=MyPWD;"

> 

> 'Create Recordset object 

> Set rs = Server.CreateObject("ADODB.Recordset")

> Set rs.ActiveConnection = cn

> 

> 'Check to see if record already exists

> sSql = "sGROUPUSERSelect"

> sSql = sSql & "'" & iUserID & "', " & "'" 		

> Set rs = cn.Execute(sSql)

> 

> TIA.

> 

> Rita

Message #3 by Rita Greenberg <rg1@h...> on Tue, 17 Apr 2001 07:31:31 -0700
Hi Hari.



Thanks for your great explanation!



Rita



-----Original Message-----

From: Hariharan [mailto:hariharan_m2001@r...]

Sent: Tuesday, April 17, 2001 1:09 AM

To: ASP Web HowTo

Subject: [asp_web_howto] Re: Default Lock for RecordSet





Hi Rita,

 

  Set rs = cn.Execute(sSql)



  When u open such a type of recorset then the returned Recordset object 

is always a read-only, forward-only cursor.



If you need a Recordset object with more functionality, first create a 

Recordset object with the desired property settings, then use the 

Recordset object's Open method to execute the query and return the desired 

cursor type





Regards,

Hari



> Hi.

> 

> What's the default type of lock for this recordset?

> 

> Dim cn						

> Dim sSql						

> Dim rs							

> 

> 'Set up the connection to database

> Set cn = server.CreateObject("ADODB.Connection")

> cn.Open "DSN=MyDSN; uid=MyUID; pwd=MyPWD;"

> 

> 'Create Recordset object 

> Set rs = Server.CreateObject("ADODB.Recordset")

> Set rs.ActiveConnection = cn

> 

> 'Check to see if record already exists

> sSql = "sGROUPUSERSelect"

> sSql = sSql & "'" & iUserID & "', " & "'" 		

> Set rs = cn.Execute(sSql)

> 

> TIA.

> 

> Rita


  Return to Index