Hi all,
im nearly there with this one and im sure it shouldnt be hard to solve, i just cant seem to find the solution.
ive got records being displayed, the user can then tick what records to delete... click delete.. it shows deleted records then you can go back to the screen, It works if one record is selected but any more it doesnt delete any so im sure there is a problem with my SQL statement.
the code for the 2 pages have been shown below:
The code for the selection page
=============== ========
code for the delete action page
=============== =======
any help will be MUCH appreciated
kind regards
jason
im nearly there with this one and im sure it shouldnt be hard to solve, i just cant seem to find the solution.
ive got records being displayed, the user can then tick what records to delete... click delete.. it shows deleted records then you can go back to the screen, It works if one record is selected but any more it doesnt delete any so im sure there is a problem with my SQL statement.
the code for the 2 pages have been shown below:
The code for the selection page
=============== ========
Code:
<% If rssearchcnx.BOF and rssearchcnx.EOF Then%> We appolagise, but no flights were found matching your search </div> <p align="center"><a href="search.asp" target="mainFrame">please try again</a></p> <%Else%> <%If Not rssearchcnx.BOF Then%> <% Do While Not rssearchcnx.EOF %> <tr> <td ><%=rssearchcnx("flight_id")%></td> <td><form name="update" method="post" action="flight_update.asp"><input type="hidden" value="<%=(rssearchcnx.Fields.Item("flight_id").Value)%>" name="flight_id" /><input type="submit" value="update" /></form></td> <td><form name="form" method="post" action="delete.asp"><input type="checkbox" name="flight_id" value="<%=(rssearchcnx.Fields.Item("flight_id").Value)%>"></td> </tr> <% rssearchcnx.MoveNext Loop %> </table> <%End If%> <%End If%> <input type="submit" value="Delete Selected Records"> </form> <% rssearchcnx.Close searchcnx.Close %>
=============== =======
Code:
<% Dim flight_id flight_id = Request.Form("flight_id") SQL="DELETE * FROM tbl_flight_details WHERE flight_id ='"+Request.Form("flight_id")+"'" Set MyConn=Server.CreateObject("ADODB.Connection") MyConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\ddwassignment3\airlines.mdb" Set MyRS=Server.CreateObject("ADODB.RecordSet") MyRS.Open SQL,MyConn %> </p> <table width="37%" border="0" align="center"> <tr> <td align="center"><% Response.Write("<font face=Calibri>You have deleted flight number <B><font face=Calibri color=Red>" & flight_id)%></font></B></td>
kind regards
jason
Comment