Possible Duplicate:
Classic ASP SQL Injection Protection
So far, I've been very lucky not to have my website attacked by SQL injection, and possibly many other methods too.
I would like to know how to convert my login query to use parameters, which apparently will stop this kind of attack occurring.
My query is actually quite complicated, so I will show a simple version in this post, so then I can study the converted version and then try and implement it to my real query later.
This is what I currently have (simplified), which is asking for trouble:
username = Trim(Request("username"))
password = Trim(Request("password"))
SQL = " SELECT clientID FROM clientAccounts
WHERE username = '"&username&"'AND password = '"&password&"'; "
Set rs = conn.Execute(SQL)
I would greatly appreciate if somebody could show me how this would look, using parameters, to protect it from injection.
Regards