Hi,
Few days I Faced Poblem Regarding Parmaterized Query in Classic Asp...
After Some Few Hours Of Work I have Completed That Work Show I will Show very Simple
Implementaion of My work..
What I have used...
IIS6.0
Vbscripting
and XP machince
What is Requirement
It will prevent The Sql Injection..
Know I Provide With Simple Sample With Open Query..
'Sql server Connectiion String
Conn="Provider=SQLOLEDB;User ID=sa;password=a;Initial Catalog=northwind;Data Source=Avinash"
Const adCmdText = 1
Dim cmd2
Set cmd2 = Server.CreateObject("ADODB.Command")
cmd2.ActiveConnection = Conn
cmd2.CommandText = "SELECT * FROM Categories WHERE CategoryID = ? "
cmd2.CommandType = adCmdText
cmd2.Parameters(0).Value = count1
' cmd2.Parameters(2).Value = Request.Form("password")
Set rstLogin = cmd2.Execute
Response.Write("Data Came From "& aFixed(i) & " == " & rstLogin(1) & "
")
Hope This Help Some One..
No comments:
Post a Comment