asp dll 存储
'打开用户列表
Public Function show(conn) As ADODB.Recordset
Call ck
Dim cmd As New ADODB.Command
With cmd
.ActiveConnection = conn
.CommandText = "user_show"
.CommandType = 4
.Prepared = True
End With
Set show = cmd.Execute()
Set cmd = Nothing
End Function
打开数据库的CONN这里省略。。
Dim bicjjer
Set bicjjer=Server.CreateObject("jyerp.cs")
Set Rs=bicjjer.show(conn)
do while not rs.eof
response.write rs(0)&" <br>"
rs.movenext
loop
Set bicjjer = Nothing
我从外部ASP文件引入CONN,这个没有传入参数的存储执行成功
'打开用户列表
Public Function cms(conn, ByVal strwhere As String) As ADODB.Recordset
Dim cmd As New ADODB.Command
Dim rs, qx
With cmd
.ActiveConnection = conn
.CommandText = "show2"
.CommandType = 4
.Prepared = True
.Parameters.Append .CreateParameter("@bname", 200, 1, 50, "[user]")
.Parameters.Append .CreateParameter("@zname", 200, 1, 200, "user_qx")
.Parameters.Append .CreateParameter("@strWhere", 200, 1, 200, strwhere)
End With
Set rs = cmd.Execute()
qx = rs("user_qx")
Set cmd= Nothing
Set rs = Nothing
End Function
strwhere="user_id=1"
Set bicjjer=Server.CreateObject("jyerp.cs")
bicjjer.cms(conn,strwhere)
response.write qx
这句为什么不行?不要去讨论存储对不对,在ASP下测试通过的,为什么我这个传入参数存储执行不起来?