cool263
02-07-2007, 08:40 PM
I'm trying to delete multiple records, but I keep getting an error: Data type mismatch in criteria expression.
Here's the code I'm working with:
<!--#INCLUDE FILE="connection.asp" -->
<%
DIM SQL, objRS, strID
strID = Request.Form("idnumber")
SQL = "SELECT * FROM records WHERE ID = ' " & strID & " ' "
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open SQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText
IF objRS.EOF THEN
Response.Write "Sorry, you do not have any customers.
ELSE
DO WHILE NOT objRS.EOF
objRS.Delete
objRS.MoveNext
Loop
Response.Write "Your customers have been succesffully deleted from your database."
END IF
objRS.Close
Set objRS = Nothing
objCONN.Close
Set objCONN = Nothing
%>
I'm still fairly new to programming. Any suggestions?
Here's the code I'm working with:
<!--#INCLUDE FILE="connection.asp" -->
<%
DIM SQL, objRS, strID
strID = Request.Form("idnumber")
SQL = "SELECT * FROM records WHERE ID = ' " & strID & " ' "
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open SQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText
IF objRS.EOF THEN
Response.Write "Sorry, you do not have any customers.
ELSE
DO WHILE NOT objRS.EOF
objRS.Delete
objRS.MoveNext
Loop
Response.Write "Your customers have been succesffully deleted from your database."
END IF
objRS.Close
Set objRS = Nothing
objCONN.Close
Set objCONN = Nothing
%>
I'm still fairly new to programming. Any suggestions?