咔波碧宝:
[技术贴]哪位对asp熟悉阿,用command使用查询参数,为什么查不出来
[阅读: 442] 2005-11-11 13:13:54
<%
Dim Cmd,prm,rs
Set Cmd = Server.CreateObject("ADODB.Command")
Set rs = Server.CreateObject("ADODB.RecordSet")
Set Cmd.ActiveConnection = conn
Cmd.CommandText = "select * from Temp where Caption = ?"
Cmd.CommandType = AdCmdText
Cmd.Prepared = True
Set prm = Cmd.CreateParameter("Caption", adVarChar, adParamInput, 50)
Cmd.Parameters.Append prm
Cmd("Caption") = "a"
rs.open Cmd, ,AdOpenForwardOnly, AdLockReadOnly,adCmdText
if rs.RecordCount > 0 then
response.write "YES"
else
response.Write "NO"
end if
rs.close
conn.close
%>

I think I m cute.
I know I m sexy.
I'm just a sexy boy.
凸╰_╯凸