存储过程碰到怪问题,请大家帮我看看
<%
'存储过程执行脚本
Set Mycommand.ActiveConnection = Myconn
Mycommand.CommandType = adCMdStoredProc
Mycommand.CommandText = "KaoHe_d"
Set MyParam1 = Mycommand.CreateParameter("Kname",adVarChar,adparaminput,50)
Mycommand.Parameters.Append MyParam1
Set MyParam2 = Mycommand.CreateParameter("starttime",adDate,adparaminput,30)
Mycommand.Parameters.Append MyParam2
Set MyParam3 = Mycommand.CreateParameter("endtime",adDate,adparaminput,30)
Mycommand.Parameters.Append MyParam3
Set MyParam4 = Mycommand.CreateParameter("State",adInteger,adparamOutput,30)
Mycommand.Parameters.Append MyParam4
Mycommand("Kname") = request("kname")
Mycommand("starttime") = request("start")
Mycommand("endtime") = request("end")
Mycommand.Execute
if Mycommand("State")=1 then
response.write"<script>alert('统计表生成成功!');window.location.href='kaohemanage.asp';</Script>"
response.end
else
response.write"<script>alert('统计表生成失败!检查统计名称是否有重复');history.back();</Script>"
response.end
end if
%>
调试后确认request("kname")的值没有问题
如果request("kname")的值为汉字,小写字符入库Kname字段都为空值
更奇怪的是,如果request("kname")为大写字符,它只入库第一个字符,其他几个字段入库都没有问题
如"adsadada","撒大撒大似的按时",入库字段"NULL"
"SDFASDSADA",入库字段"S"
请大家帮我解决