正确的ASP程序换了机器就没有办法执行了,是怎么回事啊?
我用的ASP程序,以前在NT4机器上可以正常执行,我想把它移植到Win2000下,可是,程序却出现了错误。
我的ASP程序连接的是SQL Server 2000,不用配置ODBC。
下面是我的代码:
<%@ Language=VBScript %>
<% response.buffer=true %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
</HEAD>
<BODY>
<P> </P>
<script language=vbscript>
sub get_bianma()
i=0
while i<Parent.frames.length
if left(Parent.frames.item(i).name,6)="frame_" then
if Parent.frames.item(i).this_form.list.value<>"" and Parent.frames.item(i).this_form.list.value<>"0" then
ss=Parent.frames.item(i).location
pp=instr(1,ss,"?base=")
first_p=instr(pp,ss,"_")
second_p=instr(first_p+1,ss,"_")
ll=cint(mid(ss,first_p+1,second_p-first_p-1))
kk=left(Parent.frames.item(i).this_form.list.value,instr(1,Parent.frames.item(i).this_form.list.value,"-")-1)
bb=right(kk,ll)
bianma=bianma+bb
else
this_form.bianma_text.value="尚未完整选择"
i=Parent.frames.length-1
end if
end if
i=i+1
wend
if len(bianma)=16 then
this_form.bianma_text.value=bianma
end if
end sub
</script>
<%if Request("bianma_text")<>"" then
set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = session("Conn")
cmdDC.CommandType = 1
cmdDC.CommandText = "declare @ttt varchar(255) exec zidian_proc '"+Request("bianma_text")+"',@ttt OUT select @ttt"
'Create recordset and retrieve values using command obj
set rsDC=Server.CreateObject("ADODB.Recordset")
rsDC.open cmdDC, ,0,1
i=1
while i=1
(此处报错:) if rsDC.Fields.Count>0 then
if left(rsDC(0),1)="|" then
str=rsDC(0)
i=2
end if
end if
set rsDC=rsDC.NextRecordset(1)
wend
sql1="insert into bianma_"+session("shenfen")+"(bianma"
sql2="values('"+request("bianma_text")+"'"
sql3=""
first_p=2
second_p=instr(2,str,"|")
while second_p<>0
str_tmp=mid(str,first_p,second_p-first_p)
sql1=sql1+","+left(str_tmp,instr(1,str_tmp,"$")-1)
sql3=sql3+",'"+right(str_tmp,len(str_tmp)-instr(1,str_tmp,"$"))+"'"
first_p=second_p+1
second_p=instr(first_p,str,"|")
wend
if first_p<len(str) then
str_tmp=right(str,len(str)-first_p+1)
sql1=sql1+","+left(str_tmp,instr(1,str_tmp,"$")-1)
sql3=sql3+",'"+right(str_tmp,len(str_tmp)-instr(1,str_tmp,"$"))+"'"
end if
sql=sql1+",inputtime) "+sql2+sql3+",'"& now() &"')"
set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = session("Conn")
cmdDC.CommandType = 1
cmdDC.CommandText = sql
'Create recordset and retrieve values using command obj
set rsDC=Server.CreateObject("ADODB.Recordset")
rsDC.open cmdDC, ,0,1
Response.Redirect "to_bianma.asp"
end if
%>
<form name=this_form action=ins_bm.asp>
<center>
<table width="80%" border="0">
<tr>
<td>
<form name=this_form action=ins_bm.asp>
<input type="button" size=9 height=10 value="预览编码:" onclick="vbscript:get_bianma()" id=button1 name=button1>
<input type="text" readonly size=16 height=10 border=0 id=text1 name=bianma_text>
<input type="submit" size=9 height=10 value="生成编码" id=button2 name="submit">
</form>
<form name=this_form action=weihu_bm.asp target=new_win>
<input type="submit" size=9 height=10 value="维护编码" id=button2 name="submit">
<input type="hidden" name=tab_name value=<%=session("shenfen")%>>
</form>
</td>
</tr>
</table>
</center>
</BODY>
</HTML>
报错提示:
Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: 'rsDC'
/bmgl/ins_bm.asp,行53
有没有能帮我解决的,工作急用阿,谢谢各位了!