I am having trouble deleting records from an Access database using the following code. There are 2 SQL statements.
1 - Deletes the record indicated in the QueryString
2 - Deletes all records where the length of one field is less than 3
Here's the code
Here's the error I'm gettingCode:<% Dim cnn Dim rst Dim ConnectString Dim strSQL Dim strDelSQL Set cnn = Server.CreateObject("ADODB.Connection") Set rst = Server.CreateObject("ADODB.Recordset") ConnectString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & Server.MapPath("database/tickets.mdb") strSQL = "DELETE * FROM RRS_Tickets WHERE TicketID = " & Request.QueryString("Record") strDelSQL = "DELETE * FROM Tickets WHERE Len(Ticket_Number) < 3" cnn.Open ConnectString rst.Open strDelSQL, cnn, 2, 2 rst.Close rst.Open strSQL, cnn, 2, 2 rst.Close cnn.Close Set rst = Nothing Set cnn = Nothing Response.Redirect("Tickets.asp") %>
Thank you for any help.Code:ADODB.Recordset error '800a0e78' The operation requested by the application is not allowed if the object is closed. ?




Reply With Quote