日期:2014-05-16 浏览次数:20933 次
Set rs_cmd = Server.CreateObject("ADODB.Command")
rs_cmd.ActiveConnection = conn
rs_cmd.CommandText = "SELECT * FROM user WHERE id = ?"
rs_cmd.CommandType = 1 'adCmdText
rs_cmd.Parameters.Append rs_cmd.CreateParameter("id", 5, 1, -1, 888)
Set rs = rs_cmd.Execute()
'或者
Set rs = rs_cmd.Execute(, Array(888))
rs_cmd.CommandText = "SELECT * FROM user WHERE id IN (?)"
rs_cmd.Parameters.Append rs_cmd.CreateParameter("ids", 5, 1, -1, "777,888,999")
Set rs = rs_cmd.Execute()
'或者
Set rs = rs_cmd.Execute(, Array("777,888,999"))