简体   繁体   中英

Microsoft VBScript runtime error '800a01a8' : object required

Hi i have an ASP page that call function with 2 parameters

when i call the function from the asp page i am getting this error

Microsoft VBScript runtime error '800a01a8' Object required: '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

set MyOrsk = GetAllInv.AllPerInfo4xfm(ssgr,nat)

=>

MyOrsk = GetAllInv.AllPerInfo4xfm(ssgr,nat)

Update wrt comment:

If AllPerInfo4xfm() should return a recordset, make sure the function contains a line

Set AllPerInfo4xfm = objRecordset 

(replace objRecordset with your variable name; now, of course, the Set in the assignment to MyOrsk is needed)

Update wrt OT's revision:

Given the revised code, both GetAllInv and myors2 should be checked. Are they valid objects when the line is executed?

cf. food for thought

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM