 |
Mycket flitig postare
|
|
Reg.datum: Mar 2003
Inlägg: 663
|
|
Mycket flitig postare
Reg.datum: Mar 2003
Inlägg: 663
|
Postar hela koden istället.
Fil1
<form name="form1" method="post" action="ta_bort_admin2.asp">
<input type="text" name="txtPID" maxlength="50" size="40">
<input type="submit">
</form>
Fil2
<% @LANGUAGE=VBScript %>
<% Option Explicit %>
<!-- #include file="adovbs.inc" -->
<%
Dim PID
PID = Request("txtPID")
'Öppnar en koppling mot databasen
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=lembit"
objConn.Open
'Ta bort
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "Prod", objConn,adOpenDynamic,adLockOptimistic
objConn.Execute "DELETE FROM Prod WHERE PID = '" & PID & "'"
'Städa upp
objRS.Close
set objRS = Nothing
objConn.Close
set objConn = Nothing
Response.Redirect("lagg_till_admin_klar.html")
%>
|