Good morning every one,
I want to delete records in my database by using connectingString e.g write id=6
to delete instead of this code
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open"C:\Inetpub\wwwroot\template\database\database1.mdb"
pid=Request.Form("PatientId")
if Request.form("Patientname")="" then
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "SELECT * FROM Patient WHERE PatientId=" & pid,conn
%>
<form method="post" action="demo_delete.asp">
<table>
<%for each x in rs.Fields%>
<tr>
<td><%=x.name%></td>
<td><input name="<%=x.name%>" value="<%=x.value%>"></td>
<%next%>
</tr>
</table>
<br /><br />
<input type="submit" value="Delete record">
</form>
<%
else
sql="DELETE FROM Patient"
sql=sql & " WHERE PatientId=" & pid
on error resume next
conn.Execute sql
if err<>0 then
response.write("No update permissions!")
else
response.write("Record " & pid & " was deleted!")
end if
end if
conn.close
%>
anyone have idea ,can help me
best Regards