0

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

sepp2k
  • 363,768
  • 54
  • 674
  • 675
Noora
  • 319
  • 3
  • 10
  • 26

1 Answers1

1

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

Community
  • 1
  • 1
Ekkehard.Horner
  • 38,498
  • 2
  • 45
  • 96
  • i am getting another error Microsoft VBScript runtime error '800a01a8' Object required: '' cuz the function should return a record set – Noora Dec 28 '14 at 10:56