Ok I have another question. Now I added the drop down box to the delete page.
So when i select a category, it takes me to the correct page to delete an icon. But when I click on one it takes me to an error page that says "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. "
Here is the code for that page:
<% 'Dimension variables Dim adoCon 'Holds the Database Connection Object Dim rsDeleteIcon 'Holds the recordset for the record to be deleted Dim strSQL 'Holds the SQL query to query the database Dim lngRecordNo 'Holds the record number to be deleted Dim lngCatName
'Read in the record number to be deleted lngRecordNo = CLng(Request.QueryString("ID"))
'Create an ADO connection object Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../db/Icons.mdb")
'Create an ADO recordset object Set rsDeleteIcon = Server.CreateObject("ADODB.Recordset")
category = Request("category")
select case category case "GAME" strSQL = "SELECT game.* FROM game WHERE ID=" & lngRecordNo case "MUSIC" strSQL = "SELECT music.* FROM music WHERE ID=" & lngRecordNo case "OTHER" strSQL = "SELECT other.* FROM other WHERE ID=" & lngRecordNo case "TVMOVIES" strSQL = "SELECT tvmovie.* FROM tvmovie WHERE ID=" & lngRecordNo end select
'Set the lock type so that the record is locked by ADO when it is deleted rsDeleteIcon.LockType = 3
'Open the recordset with the SQL query rsDeleteIcon.Open strSQL, adoCon
'Delete the record from the database rsDeleteIcon.Delete
'Reset server objects rsDeleteIcon.Close Set rsDeleteIcon = Nothing Set adoCon = Nothing
'Return to the delete select page in case another record needs deleting Response.Redirect "delete_pick_cat_form.asp" %>
|
And the error is apparently on this line:
'Open the recordset with the SQL query rsDeleteIcon.Open strSQL, adoCon
|
Edited by worldwide1504