Originariamente inviato da Mems
Perdonami, ma il tuo esempio è fallato, ovvero, è soggetto a SQL Injection.
Se io nella queryString passo "id (DELETE * FROM tabella)"
vedrai che verrà felicemente interpretato.
Giusta precisazione Mems
ovviamente bisogna effettuare dei controlli sulla stringa da passare.
l'ho dato per scontato che bisognasse fare dei controlli ma mi sa che era meglio dirlo
codice:
if InStr (1,orderby,"delete")=0 and InStr (1,orderby,"select")=0 and InStr (1,orderby,"update")=0 and InStr (1,orderby,"insert")=0 then
if orderby<>"" then
sql=sql & " order by " & orderby
end if
end if