中国开发网: 论坛: 程序员情感CBD: 贴子 237304
咔波碧宝
[技术贴]哪位对asp熟悉阿,用command使用查询参数,为什么查不出来
<%
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.
凸╰_╯凸

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录