Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Deleting a Record


Message #1 by "Nadia Hamza" <hamzan@h...> on Sat, 17 Feb 2001 20:36:32
Hi,



I'm using the following code to delete a record:



            objRec.Close

 	           Set objRec = Nothing  

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

               sql1 = "SELECT Passwords.* FROM Passwords WHERE 

((Passwords.Username)='"& username &_

               "') AND ((Passwords.Password)='"& password &"');"  

               objRec.Open sql1, strConnect, adOpenStatic, adLockReadOnly, 

adCmdText   

               If objRec.EOF Then

                  Response.Write "Match not found"

                  Response.Write username & password & "help"

               Else

                  objRec.Delete adAffectCurrent

                  objRec.Update

               End If       



But I get the following error message:



ADODB.Recordset error '800a0cb3' 



The operation requested by the application is not supported by the 

provider. 



/shopcountry/administration.asp, line 63 



Any help would be greatly appreciated.  Thanks!



Nadia

Message #2 by "Dallas Martin" <dmartin@z...> on Sat, 17 Feb 2001 22:58:24 -0500
Does not  "AdLockReadOnly" pose a prooblem?



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

From: "Nadia Hamza" <hamzan@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Saturday, February 17, 2001 8:36 PM

Subject: [asp_databases] Deleting a Record





> Hi,

>

> I'm using the following code to delete a record:

>

>             objRec.Close

>              Set objRec = Nothing

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

>                sql1 = "SELECT Passwords.* FROM Passwords WHERE

> ((Passwords.Username)='"& username &_

>                "') AND ((Passwords.Password)='"& password &"');"

>                objRec.Open sql1, strConnect, adOpenStatic, adLockReadOnly,

> adCmdText

>                If objRec.EOF Then

>                   Response.Write "Match not found"

>                   Response.Write username & password & "help"

>                Else

>                   objRec.Delete adAffectCurrent

>                   objRec.Update

>                End If

>

> But I get the following error message:

>

> ADODB.Recordset error '800a0cb3'

>

> The operation requested by the application is not supported by the

> provider.

>

> /shopcountry/administration.asp, line 63

>

> Any help would be greatly appreciated.  Thanks!

>

> Nadia

>

>

> 
Message #3 by philip.moh@a... on Mon, 19 Feb 2001 10:22:37 +0800
do you need update after delete?





> -----Original Message-----

> From:	Nadia Hamza [SMTP:hamzan@h...]

> Sent:	Sunday, February 18, 2001 4:37 AM

> To:	ASP Databases

> Subject:	[asp_databases] Deleting a Record

> 

> Hi,

> 

> I'm using the following code to delete a record:

> 

>             objRec.Close

>  	           Set objRec = Nothing  

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

>                sql1 = "SELECT Passwords.* FROM Passwords WHERE 

> ((Passwords.Username)='"& username &_

>                "') AND ((Passwords.Password)='"& password &"');"  

>                objRec.Open sql1, strConnect, adOpenStatic, adLockReadOnly,

> 

> adCmdText   

>                If objRec.EOF Then

>                   Response.Write "Match not found"

>                   Response.Write username & password & "help"

>                Else

>                   objRec.Delete adAffectCurrent

>                   objRec.Update

>                End If       

> 

> But I get the following error message:

> 

> ADODB.Recordset error '800a0cb3' 

> 

> The operation requested by the application is not supported by the 

> provider. 

> 

> /shopcountry/administration.asp, line 63 

> 

> Any help would be greatly appreciated.  Thanks!

> 

> Nadia

> 

> 
Message #4 by "Wally Burfine" <oopconsultant@h...> on Mon, 19 Feb 2001 04:41:26 -0000
Nadia,



adOpenStatic, adLockReadOnly means that you can't update the recordset.





>From: "Nadia Hamza" <hamzan@h...>

>Reply-To: "ASP Databases" <asp_databases@p...>

>To: "ASP Databases" <asp_databases@p...>

>Subject: [asp_databases] Deleting a Record

>Date: Sat, 17 Feb 2001 20:36:32

>

>Hi,

>

>I'm using the following code to delete a record:

>

>             objRec.Close

>  	           Set objRec = Nothing

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

>                sql1 = "SELECT Passwords.* FROM Passwords WHERE

>((Passwords.Username)='"& username &_

>                "') AND ((Passwords.Password)='"& password &"');"

>                objRec.Open sql1, strConnect, adOpenStatic, adLockReadOnly,

>adCmdText

>                If objRec.EOF Then

>                   Response.Write "Match not found"

>                   Response.Write username & password & "help"

>                Else

>                   objRec.Delete adAffectCurrent

>                   objRec.Update

>                End If

>

>But I get the following error message:

>

>ADODB.Recordset error '800a0cb3'

>

>The operation requested by the application is not supported by the

>provider.

>

>/shopcountry/administration.asp, line 63

>

>Any help would be greatly appreciated.  Thanks!

>

>Nadia

>

>
Message #5 by "Kamran" <user_15@h...> on Mon, 26 Feb 2001 01:09:01
When deleting a record from the Access or SQL database always use the 

following cursor/locktype combinations --->





adOpenKeySet (or adOpenStatic, or adOpenDynamic), adLockOptimistic (or 

adLockPessimistic)



adOpenStatic = 3

adOpenKeySet = 2

adOpenDynamic = 1

adLockOptimistic = 2

adLockPessimistic = 3





> Hi,

> 

> I'm using the following code to delete a record:

> 

>             objRec.Close

>  	           Set objRec = Nothing  

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

>                sql1 = "SELECT Passwords.* FROM Passwords WHERE 

> ((Passwords.Username)='"& username &_

>                "') AND ((Passwords.Password)='"& password &"');"  

>                objRec.Open sql1, strConnect, adOpenStatic, 

adLockReadOnly, 

> adCmdText   

>                If objRec.EOF Then

>                   Response.Write "Match not found"

>                   Response.Write username & password & "help"

>                Else

>                   objRec.Delete adAffectCurrent

>                   objRec.Update

>                End If       

> 

> But I get the following error message:

> 

> ADODB.Recordset error '800a0cb3' 

> 

> The operation requested by the application is not supported by the 

> provider. 

> 

> /shopcountry/administration.asp, line 63 

> 

> Any help would be greatly appreciated.  Thanks!

> 

> Nadia

Message #6 by Philo <philo@r...> on Sun, 25 Feb 2001 21:37:11 -0500

Assuming your only desire is to delete a record, wouldn't the following be 

more efficient:



sql="DELETE FROM Passwords WHERE [whereclause]"

cxnADO.execute sql



?



Philo



At 01:09 AM 2/26/2001 +0000, Kamran wrote:

>When deleting a record from the Access or SQL database always use the

>following cursor/locktype combinations --->

>

>

>adOpenKeySet (or adOpenStatic, or adOpenDynamic), adLockOptimistic (or

>adLockPessimistic)

>

>adOpenStatic = 3

>adOpenKeySet = 2

>adOpenDynamic = 1

>adLockOptimistic = 2

>adLockPessimistic = 3



philo@r...	AOLIM: philo589		ICQ: 9802707

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Natural Laws have no pity.

       -Lazarus Long



Message #7 by "Ken Schaefer" <ken@a...> on Mon, 26 Feb 2001 14:45:47 +1100
Don't forget adExecuteNoRecords (ASP creates a recordset then throws it away

if you return no records):



strSQL = "DELETE FROM Passwords WHERE [whereclause]"

Call objConn.Execute(strSQL,,adCmdText+adExecuteNoRecords)



Cheers

Ken



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

From: "Philo" <philo@r...>

To: "ASP Databases" <asp_databases@p...>

Sent: Monday, February 26, 2001 1:37 PM

Subject: [asp_databases] Re: Deleting a Record





>

> Assuming your only desire is to delete a record, wouldn't the following be

> more efficient:

>

> sql="DELETE FROM Passwords WHERE [whereclause]"

> cxnADO.execute sql

>

> ?

>

> Philo

>

> At 01:09 AM 2/26/2001 +0000, Kamran wrote:

> >When deleting a record from the Access or SQL database always use the

> >following cursor/locktype combinations --->

> >

> >

> >adOpenKeySet (or adOpenStatic, or adOpenDynamic), adLockOptimistic (or

> >adLockPessimistic)

> >

> >adOpenStatic = 3

> >adOpenKeySet = 2

> >adOpenDynamic = 1

> >adLockOptimistic = 2

> >adLockPessimistic = 3

>

> philo@r... AOLIM: philo589 ICQ: 9802707

> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

> Natural Laws have no pity.

>        -Lazarus Long

>

>

>

> ---

> Please take a moment to tell us how you are using AuthentiX, WebQuota, and

> VideoQuota

>

> http://www.flicks.com/feedback/feed.asp

>

> Scott Gordon

> Marketing

> Flicks Software

> www.flicks.com

>  xxx-xxx-xxxx




$subst('Email.Unsub')

>




  Return to Index