请问:为什么我在ASP中调用存储过程总是出错?

ypp 2000-03-31 11:19:00
我在ASP中调用存储过程,代码如下:
Sub Session_OnStart
set session("AdoCn")=Server.CreateObject("ADODB.Connection")
session("AdoCn").Open "DRIVER=SQL server;SERVER=mnserver;DATABASE=IntTel;UId=sa;PASSWORD=;"
End Sub
调用时的连接:
set AdoQd=Server.CreateObject("ADODB.Command")
set AdoQd.ActiveConnection =session("AdoCn")
AdoQd.CommandType =adCMdStoredProc ??
AdoQd.CommandText ="TelBusiness"
为什么总出错?
ADODB.Command 错误 '800a0bb9'
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.
/MyProject1/TelBusEnd.asp, (AdoQd.CommandText=adCmdStoredProc)
...全文
149 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
蝈蝈俊 2000-03-31
  • 打赏
  • 举报
回复
AdoQd.CommandType =adCMdStoredProc
AdoQd.CommandText ="TelBusiness"
换一下先后顺序,试一试

AdoQd.CommandText ="TelBusiness"
AdoQd.CommandType =adCMdStoredProc
weity 2000-03-31
  • 打赏
  • 举报
回复
请问 你有没有用过 asp 网页将数据转换成 pdf 形式!
我在做这个项目 很烦的!
weity 2000-03-31
  • 打赏
  • 举报
回复
我用的 AdoConnection 是在一个asp 中建立的,
不知道有没有影响!?
weity 2000-03-31
  • 打赏
  • 举报
回复
建议 先显示 存储过程的所有参数,可能是参数类型不对
在AdoQd.commandType的后面 加上下面语句
AdoQd.parameters.refresh

注意 先设置CommandText 然后设置CommandType

ypp 2000-03-31
  • 打赏
  • 举报
回复
我的ADOCONNECTION是在session_onstar中打开的。
为什么顺序调换后也不行?
mog 2000-03-31
  • 打赏
  • 举报
回复
如果参数AreaNo仅是作为输入参数的话不用这么复杂,只需这样set AdoQd=Server.CreateObject("ADODB.Command")
set AdoQd.ActiveConnection =session("AdoCn")
AdoQd.CommandType =4
AdoQd.CommandText ="TelBusiness('"&request("AreaNo")&"')"
AdoQd.execute
这样就可以了

weity 2000-03-31
  • 打赏
  • 举报
回复
你的ADOConnection 不是在这个asp 中打开的吗?
在有 CommandType 和 CommandText 是有顺序的
ypp 2000-03-31
  • 打赏
  • 举报
回复
set AdoQd=Server.CreateObject("ADODB.Command")
set AdoQd.ActiveConnection =session("AdoCn")
AdoQd.CommandType =4
AdoQd.CommandText ="TelBusiness"
set TmpIn1=AdoQd.CreateParameter ("AreaNo",adVarChar,adParamInput,6,Request.Form("AreaNo")) ??
AdoQd.Parameters.Append TmpIn1
为什么总会有下面错误?
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another

28,390

社区成员

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

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