Discussion Locked
0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How do I delete records from an asp page using FrontPage from my Access 2000 database? I can add the records to the database from an asp page but am unable to delete them the same way. I also will need to find out how to update any records if possible for any changes.
7 replies
by md_hashim
Have you checked for relationships with other recorde before doing a delete? If the records are related then you need to un-relate the records before you are able to delete them.
The question was auto-closed by TechRepublic
by jfarmer
If you have the ID or a unique field for the record you want to delete, you can use the folowing ASP:
Sub DelRecord()
Set cmdDel = Server.CreateObject("ADODB.Command")
Set objRS = Server.CreateObject("ADODB.Recordset")
cmdDel.CommandText = "DELETE FROM tblDates WHERE DatesID = " & sDatesID
cmdDel.CommandType = 1
Set cmdDel.ActiveConnection = objDB
objRS.Open cmdDel
Response.Write("Date " & sLocDate & " deleted from database.
")
CmdDel.Close
objRS.Close
CmdDel = Nothing
objRS = Nothing
End Sub
branwen
The question was auto-closed by TechRepublic
by jfarmer
The previous answer is of course assuming you have already established a connection to your database in the objDB object.
The question was auto-closed by TechRepublic
This question was auto closed due to inactivity
This discussion is closed to new replies.
Trending Desktop posts
Sort by Trending
0 helpful
1 reply
Question
Floppy drive wont work on my 486
0 helpful
1 reply
Discussion
How to make light speed agent go away
0 helpful
4 replies
Discussion Locked
Ryzen 7 7700
0 helpful
2 replies
Question Locked
Issue fully resetting my PC
0 helpful
4 replies