Gossamer Forum
Home : General : Databases and SQL :

Help on deleting.

Quote Reply
Help on deleting.
I got a problem deleting the row of info after i successfully insert it into my database.

This the code for it.

Thank You in Advance.


<title>updating a record</title></head>

<h2>Updating Record</h2>

set conn=Server.CreateObject("ADODB.Connection")

dim soStaffid

soStaffid = request.QueryString("so")


if Request.form("Course_Title")="" then
set rs=Server.CreateObject("ADODB.Recordset")
rs.open "SELECT * FROM reg WHERE Staffid = " & soStaffid, conn


<form method="post" action="record_update_staff.asp">
<%for each x in rs.Fields%>
<td><input name="<%=x.name%>" value="<%=x.value%>"></td>

<input type="submit" value="Add"><BR><BR><BR>
<td>click on back to reSelect</td>


sql="INSERT INTO Info (Name,Designation,Course_Title,Start_Date,Days,Dept)"

sql=sql & " VALUES "
sql=sql &"('" & Request.Form("Name") &"',"
sql=sql &"'" & Request.Form("Designation") &"',"
sql=sql &"'" & Request.Form("Course_Title") &"',"
sql=sql &"'" & Request.Form("Start_Date") &"',"
sql=sql &"'" & Request.Form("Days") &"',"
sql=sql &"'" & Request.Form("Dept") &"')"

on error resume next
conn.Execute sql
if err<>0 then
response.write(sql &" "& err.description & "No update permissionS!")
Response.Write("Record Added")

sql="DELETE * from Reg where Staffid='"&soStaffid&"'"

<a href="view_reg.asp" STYLE='text-decoration: none'>Back</a>
end if
end if



Quote Reply
Re: [gnehs] Help on deleting. In reply to
What error message do you receive?
Buh Bye!

Quote Reply
Re: [Stealth] Help on deleting. In reply to
HEY Thank....by chance i solve it oredi.

Thank you very much