PDA

View Full Version : how can I delete the default record in asp



SBUH
August 27th, 2003, 01:41 AM
hello, my situation is here in my asp page,
.................................................. .................................................. ....
set rs=Server.CreateObject("ADODB.recordset")
sql="select * from Tshirtproduct where cus_id='"&session("ID")&"'"
rs.Open sql,Conn
do until rs.EOF
.................................................. .................................................. ....

response.write("Remove")---I need to make it work

response.write("Tshirt View")

response.write(rs("quantityL"))

response.write(rs("totalprice"))

response.write(rs("systime"))

response.write(rs("confirm"))-----this is the condition col.

.................................................. .................................................. .....
rs.MoveNext

loop
rs.close
conn.close

.................................................. .................................................. ....
I want to make the "remove" works-----delete this record when "confirm " value is 0 in MS SQL 2000.

Plz help me! Thanks!

Digitalosophy
August 27th, 2003, 10:05 PM
Something like this should work


<% @ Language = "VBScript" %>

<% Dim conn %>
<%
Set conn = server.createobject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("yourdb.mdb")
sql="select * from Tshirtproduct where cus_id='"&session("ID")&"'"
sqlDelete = "DELETE FROM main WHERE confirm = ' 0 ' "

rs.Open sql,sqlDelete, conn
%>

SBUH
August 28th, 2003, 04:34 AM
hello, we only have the response.write("remove") on the page. Then how can we connect with this vb script to make it work when the user click the remove words ? thanks!

SBUH
August 28th, 2003, 06:12 AM
how about something like this?

if rs("confirm")="0" then

response.write("Remove")

end if

and I want to make a popup window for those have "remove", how to make it show the popup window showing the message
" are you sure to delete it
Yes No"
?