asp dll 存储

yejian520 2009-07-31 05:14:57
'打开用户列表
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下测试通过的,为什么我这个传入参数存储执行不起来?
...全文
66 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jey 2009-07-31
  • 打赏
  • 举报
回复
up
Go 旅城通票 2009-07-31
  • 打赏
  • 举报
回复
你的qx变量是过程cms中定义的,

response.write qx

此qx在cms外部,怎么能访问到cms内部的变量

设置cms的返回值
Set rs = cmd.Execute() 
qx = rs("user_qx")
cms=qx'===========




strwhere="user_id=1" 
Set bicjjer=Server.CreateObject("jyerp.cs")
qx=bicjjer.cms(conn,strwhere) '=========接受返回值
response.write qx
hookee 2009-07-31
  • 打赏
  • 举报
回复
response.write qx <-- asp中qx是什么?
yejian520 2009-07-31
  • 打赏
  • 举报
回复
bicjjer.cms(conn,strwhere)
应该是
bicjjer.show2(conn,strwhere)
写错不了好意思

还是上面的问题

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧