|
|
|
|
|
| | |
|
Active Server Pages asp source code database MS SQL MS Access .mdb adovbs.inc cookies calendar codes sql commands scripts asp programming tutorials iis web server components CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: Deleting multiple records in SQL DB |
From: |
cybersox |
Date: |
12/14/1999 2:30:46 AM |
IP: |
202.139.88.53 |
Here is how you do it. However, you have to use the command object.
Set conContact = Server.CreateObject("ADODB.Connection")
conContact.Open "DSN"
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = conContact
Set RecordSet = Server.CreateObject("ADODB.RecordSet")
SQL = "SELECT * FROM [Table]
cmdDC.CommandText = SQL
RecordSet.Open cmdDC, , 0, 2
For Each Item in Request.form("delete")
Item = Cint(Item)
--Move to first record
If Not RecordSet.BOF Then
RecordSet.MoveFirst
--Find the record we want to delete
Do Until RecordSet.Fields("ID") = Item
RecordSet.MoveNext
Loop
RecordSet.Delete
RecordSet.Requery
end if
Next
RecordSet.Close
Set RecordSet = Nothing
Set cmdDC = Nothing
conContact.Close
Set conContact = Nothing |
Previous Message
Follow Up - Re: Deleting multiple records in SQL DB - Charles 12/29/1999 12:42:59 PM
|
|
|
|
|
|
|
|
|
|
|
|