[英]Microsoft VBScript runtime error '800a01a8' : object required
Hi i have an ASP page that call function with 2 parameters 嗨,我有一个ASP页面,该页面调用带有2个参数的函数
when i call the function from the asp page i am getting this error 当我从asp页面调用函数时,出现此错误
Microsoft VBScript runtime error '800a01a8' Object required: 'AllPerInfo4xfm(...)' Microsoft VBScript运行时错误'800a01a8'所需对象:'AllPerInfo4xfm(...)'
my code is 我的代码是
set GetAllInv = new GetFunction
set MyOrsk = GetAllInv.AllPerInfo4xfm(ssgr,nat)
my function is 我的功能是
Public Function AllPerInfo4xfm(ssgr,nat)
dim sdir,sdir2,ssec,tlen,ssec2
tlen=len(ssgr)
sql ="Select * from Personal"
myors2.Open SQl,oConn,1,1
set Allperinfo4xf = myors2
end function
did i miss something please advice 我错过了什么吗请咨询
Assuming that AllPerInfo4xfm()
does not return an object, loose the Set
in 假设AllPerInfo4xfm()
不返回一个对象,松开Set
在
set MyOrsk = GetAllInv.AllPerInfo4xfm(ssgr,nat)
=> =>
MyOrsk = GetAllInv.AllPerInfo4xfm(ssgr,nat)
Update wrt comment: 更新wrt评论:
If AllPerInfo4xfm()
should return a recordset, make sure the function contains a line 如果AllPerInfo4xfm()
应该返回一个记录集,请确保该函数包含一行
Set AllPerInfo4xfm = objRecordset
(replace objRecordset with your variable name; now, of course, the Set
in the assignment to MyOrsk is needed) (用您的变量名称替换objRecordset;现在,当然,需要分配给MyOrsk的Set
)
Update wrt OT's revision: 更新OT的修订版:
Given the revised code, both GetAllInv
and myors2
should be checked. 给定修改后的代码,应同时检查GetAllInv
和myors2
。 Are they valid objects when the line is executed? 当执行该行时,它们是有效的对象吗?
cf. 比照 food for thought 思考的食物
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.