asp+oralce错误类型:ADODB.Command (0x800A0D5D)应用程序在当前操作中使用了错误类型的值??

future88 2008-12-19 03:33:20
错误类型:
ADODB.Command (0x800A0D5D)
应用程序在当前操作中使用了错误类型的值。
/xscj/AddStuScore.asp, 第 29 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 1.7)

网页:
POST 130 ??? /xscj/AddStuScore.asp

POST Data:
StuXH=061101++++++++++++&StuXM=061101++++++++++++&StuKCM=%BC%C6%CB%E3%BB%FA%BB%F9%B4%A1++++++&StuCJ=2&StuXF=10&StuUpd=%B8%FC%D0%C2
<% dim SqlConn,SqlCmdRecSet,SqlRecSet,SqlCmd
dim StrSQL
dim StuXH,StuXM
Dim adParaminput
Dim adInteger
Dim aadParaminput
adParaminput = 1
adInteger = 3
adVarChar = 200
sub onload()
OpenConn()
if Request.Form("StuUpd")="更新" then
Set SqlCmd=Server.CreateObject("ADODB.COMMAND")
SqlCmd.ActiveConnection=SqlConn
SqlCmd.CommandText="AddStuScore"
SqlCmd.commandType=4 '调用存储过程
'创建参数对
set StuXH=SqlCmd.CreateParameter("@XH",adVarChar,adParamInput,6)
SqlCmd.Parameters.Append(StuXH)
set StuKCM=SqlCmd.CreateParameter("@KCM",adVarChar,adParamInput,16)
SqlCmd.Parameters.Append(StuKCM)
set StuCJ=SqlCmd.CreateParameter("@CJ",adInteger,adParamInput)
SqlCmd.Parameters.Append(StuCJ)
set StuXF=SqlCmd.CreateParameter("@XF",adInteger,adParamInput)
SqlCmd.Parameters.Append(StuXF)
'为参数赋值
SqlCmd("@XH")=Request.Form("StuXH")‘这行报错???
SqlCmd("@KCM")=Request.Form("StuKCM")
SqlCmd("@CJ")=Cint(Request.Form("StuCJ"))
SqlCmd("@XF")=Cint(Request.Form("StuXF"))
SqlCmd.Execute
else
exit sub
end if
end sub
onload()
%>
对应代码是:
...全文
763 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
nevana 2008-12-20
  • 打赏
  • 举报
回复
SqlCmd("@XH")=Request.Form("StuXH")报错,两种可能:
1.request.form("stuxh")得到的值不是vchar,可改为cstr(request.form("stuxh"))
2.request.form("stuxh")得到的值是vchar,但ORACLE数据库中的字段类型不是vchar型,请检查数据库更改
future88 2008-12-20
  • 打赏
  • 举报
回复
谢谢了,但是出现了另外的问题。
future88 2008-12-19
  • 打赏
  • 举报
回复
<% dim SqlConn,SqlCmdRecSet,SqlRecSet,SqlCmd
dim StrSQL
dim StuXH,StuXM
Dim adParaminput
Dim adInteger
Dim aadParaminput
adParaminput = 1
adInteger = 3
adVarChar = 200
sub onload()
OpenConn()
if Request.Form("StuUpd")="更新" then
Set SqlCmd=Server.CreateObject("ADODB.COMMAND")
SqlCmd.ActiveConnection=SqlConn
SqlCmd.CommandText="AddStuScore"
SqlCmd.commandType=4 '调用存储过程
'创建参数对
set StuXH=SqlCmd.CreateParameter("@XH",adVarChar,adParamInput,6)'
SqlCmd.Parameters.Append(StuXH)
set StuKCM=SqlCmd.CreateParameter("@KCM",adVarChar,adParamInput,16)
SqlCmd.Parameters.Append(StuKCM)
set StuCJ=SqlCmd.CreateParameter("@CJ",adInteger,adParamInput)
SqlCmd.Parameters.Append(StuCJ)
set StuXF=SqlCmd.CreateParameter("@XF",adInteger,adParamInput)
SqlCmd.Parameters.Append(StuXF)
'为参数赋值
SqlCmd("@XH")=Request.Form("StuXH")’这行报错
SqlCmd("@KCM")=Request.Form("StuKCM")
SqlCmd("@CJ")=Cint(Request.Form("StuCJ"))
SqlCmd("@XF")=Cint(Request.Form("StuXF"))
SqlCmd.Execute
else
exit sub
end if
end sub
onload()
%>
存储过程是create or replace procedure addstuscore
(
p_xh in xs.xh%type,
p_kcm in kc.kcm%type,
p_cj in xs_kc.cj%type,
p_xf in xs_kc.xf%type
)
as
v_kch kc.kch%type;
v_count number;
begin
select kc.kch into v_kch from kc where kc.kcm=p_kcm;
select count(*) into v_count from xs_kc where xs_kc.xh=p_xh and xs_kc.kch=v_kch;

if v_count=1 then
update xs_kc set xs_kc.cj=p_cj,xs_kc.xf=p_xf where xs_kc.xh=p_xh and xs_kc.kch=v_kch;
else
insert into XS_KC VALUES(P_XH,V_KCH,P_CJ,P_XF);

end if;
end;
/

28,391

社区成员

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

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