Hi all,
I'm completely new to working with databases which I'm sure will become apparent in no time.
I'm trying to delete a complete row based on the value of the ID column, here is what I have so far.
This will obviously delete the value of the textfield that matches the value of the request.form , but I don't want to have to enter the value of every row that follows to delete it.
Could somebody we databasing know-how show me how to adjust the code to include the entire row, or link me in the right direction.
Thanks.
I'm completely new to working with databases which I'm sure will become apparent in no time.
I'm trying to delete a complete row based on the value of the ID column, here is what I have so far.
Code:
<%
rowid = server.HtmlEncode(request.form("refiddel"))
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.ConnectionString = "Data Source=" & Server.MapPath ("\Database\data.mdb")
Conn.Open
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "SELECT * from database1", Conn, 1,3
do while not rs.EOF
if Rs("dbrowid") = rowid then Rs.Delete
rs.MoveNext
loop
set Rs = nothing
set Conn = nothing
%>
This will obviously delete the value of the textfield that matches the value of the request.form , but I don't want to have to enter the value of every row that follows to delete it.
Could somebody we databasing know-how show me how to adjust the code to include the entire row, or link me in the right direction.
Thanks.