打印

正确的ASP程序换了机器就没有办法执行了,是怎么回事啊?

正确的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

有没有能帮我解决的,工作急用阿,谢谢各位了!
[fly] Yes I can ...[/fly]

TOP

数据库连接问题!
要看你的windows2000的SQL是如何设置了!比如密码等等。。。
还有,你的windows2000安装DC了吗?

TOP

数据库连接没有问题的,其他的程序都可以正常执行,就是这个页面有问题,是不是调用那个存储过程的时候出的问题,因为程序不是我开发的,我只是把它从WinNT4的IIS3移植到Win2000的IIS5就出现了这个问题。
[fly] Yes I can ...[/fly]

TOP

不解。这种问题我在做网站的时候没有遇到过。
帮你顶吧。
这个世界的生活是荒谬的!

TOP

不是很清楚。
口是心非

TOP

我的修改意见!

把这里:rsDC.open cmdDC, ,0,1

改成:rsDC.open cmdDC, ,3,1

试试吧,应该可以的!:cool:

[ Last edited by asdfasdf on 2003-6-12 at 01:47 PM ]
我疯,我狂,我侠义 我笑,我哭,我率直 真我就是最好

TOP