Create a parameterized query instead of combining user input into the query.
Here's how to do it in classic asp:
http://blog.binarybooyah.com/blog/post/Classic-ASP-data-access-using-parameterized-SQL.aspx
, , 100% SQL-, - sql, , . . , . , , - , , . - , db.