Ecco:
codice:
If pPrezzo <> "" Then
dbwhere = ""
pPrezzo = replace(pPrezzo,"'","''")
pPrezzo = replace(pPrezzo,"[","[[]")
dbwhere = dbwhere & "[Prezzo] <= '" & pPrezzo & "' or "
dbwhere = mid(dbwhere,1,len(dbwhere)-3)
Session("tablename") = tablename
Session("dbwhere") = dbwhere
'reset start record counter
startRec = 1
Session("startRec") = startRec
Else
If tablename = Session("tablename") Then
dbwhere = Session("dbwhere")
Else
dbwhere = ""
Session("dbwhere") = dbwhere
End If
End If
Poi:
codice:
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("../../../mdb-database/occasioni.mdb") & ";"
strsql = "select * from [occasioni]"
If dbwhere <> "" Then
strsql = strsql & " WHERE " & dbwhere
End If