%' Dim strDeleteList strDeleteList = Request("SDelete") 'if strDeleteList = "" then 'No items to delete 'Response.Write "You did not select any items to delete!" dim dsn dim Conn dsn="DBQ=" & Server.Mappath("../guestbook.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};" Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open dsn 'Else 'Open a connection to the database 'Dim objConn 'Set Conn = Server.CreateObject("ADODB.Connection") 'objConn.ConnectionString = "DSN=Products" 'Conn.Open 'Now, use the SQL set notation to delete all of the records 'specified by strDeleteList Dim strSQL strSQL = "DELETE FROM guests WHERE ID IN (" & strDeleteList & ")" Conn.Execute strSQL 'Clean up Conn.Close Set Conn = Nothing 'Display to the user that the product have been deleted. 'End If 'Set Conn=Server.CreateObject("ADODB.Connection") 'Conn.Open dsn 'SQL = "DELETE FROM guests WHERE ID LIKE ('%" & request.querystring("ID") & "%')" ' 'SQL ="DELETE FROM guests WHERE ID IN (" & strDeleteList & ")" 'Set RS = Conn.Execute(SQL) %>
|
|
|
|||||||
| © Copyright 2007 | ||||||||