Salve :non mi funziona la pagina delete per eliminare una riga:
questo e' il codice:
dove sbaglio?
grazie:
<%@ Language=VBScript %>
<%on error resume next%>
<HTML>
<HEAD>
<title>Delete Data</title>
</head>
<body background="Fractal_Lumpy.jpg">
<%totfieldcount = 0
qString = ""%>
<%
Qvarcodice = request.querystring("codice")
If Qvarcodice = "ON" then
QueryCheckString = QueryCheckString & "codice" & "=ON&"
end if
varcodice = request.querystring("datcodice")
varcodice = replace(varcodice, "'", "''")
ReDim Preserve arrField(totFieldCount)
arrField(totFieldCount) = "codice"
if varcodice <> "" then
if totfieldcount <> 0 then qString = qString & " and"
qString = qString & " [codice] = '" & varcodice & "'"
totFieldCount = totFieldCount + 1
end if
%>
<%
QvarArticolo = request.querystring("Articolo")
If QvarArticolo = "ON" then
QueryCheckString = QueryCheckString & "Articolo" & "=ON&"
end if
varArticolo = request.querystring("datArticolo")
varArticolo = replace(varArticolo, "'", "''")
ReDim Preserve arrField(totFieldCount)
arrField(totFieldCount) = "Articolo"
if varArticolo <> "" then
if totfieldcount <> 0 then qString = qString & " and"
qString = qString & " [Articolo] = '" & varArticolo & "'"
totFieldCount = totFieldCount + 1
end if
%>
<%
Qvarprezzo = request.querystring("prezzo")
If Qvarprezzo = "ON" then
QueryCheckString = QueryCheckString & "prezzo" & "=ON&"
end if
varprezzo = request.querystring("datprezzo")
varprezzo = replace(varprezzo, "'", "''")
ReDim Preserve arrField(totFieldCount)
arrField(totFieldCount) = "prezzo"
if varprezzo <> "" then
if totfieldcount <> 0 then qString = qString & " and"
qString = qString & " [prezzo] = " & varprezzo
totFieldCount = totFieldCount + 1
end if
%>
<%if totfieldcount <> 0 then
Set adoConnection = server.CreateObject("ADODB.Connection")
Set adoRecordset = server.CreateObject("ADODB.Recordset")
adoConnection.Provider = "Microsoft.Jet.OLEDB.4.0"
Dim strLocation, iLength
strLocation = Request.ServerVariables("PATH_TRANSLATED")
iLength = Len(strLocation)
iLength = iLength - 10
strLocation = Left(strLocation, iLength)
strLocation = strLocation & "../mdb-database/database.mdb"
adoConnection.Open ("Data Source=" & strLocation)
adoRecordset.ActiveConnection = AdoConnection
if qString <> "" then
response.write(qstring)
adoRecordset.open ("delete from [listino] where " & qString)
response.redirect("getdata.asp?" & mid(QueryCheckString,1,len(QueryCheckString)-1)) & "&NAV=" & request.querystring("NAV")
else
response.write("no data specified")
end if
end if%>
</body>
</html>