How do I run a parameterized SQL query in classic ASP? And is it secure?

后端 未结 1 468
暗喜
暗喜 2021-01-12 16:52

I\'m about to have to deal with some SQL code in classic ASP VBScript.

I have two questions.

First, in .net, I\'m used to using the System.Data.SqlClient nam

相关标签:
1条回答
  • 2021-01-12 17:13

    There are ADODB Objects which do basically the same thing. ADODB.Command object is the equivalent to SqlCommand. From there it is basically doing the same as in .NET.

    set cmd = Server.CreateOject("ADODB.Command")
    cmd.CommandText = "select From Table where ID = @id")
    set param = cmd.CreateParameter("@id", adInteger, adInput,0,0)
    

    I frequently use w3schools for help about ADO objects.

    0 讨论(0)
提交回复
热议问题