How can I make a prepared statement in classic asp that prevents sql injection?

后端 未结 3 811
旧巷少年郎
旧巷少年郎 2020-12-10 21:25

I have this which works:

sqlString = \"SELECT * FROM employees WHERE lastname = \'\" & last_name & \"\'\"
Set cmd = Server.CreateObject(\"ADODB.Comma         


        
3条回答
  •  失恋的感觉
    2020-12-10 21:52

    The easiest is using stored procedures in SQL and using Commands that way.. Otherwise, you have to escape out certain characters being gathered from the Request object, like single quotes and double hyphens, etc.

提交回复
热议问题