Runtime error trying to send another object as a p

Results 1 to 2 of 2

Thread: Runtime error trying to send another object as a p

  1. #1
    Walt Phillips Guest

    Default Runtime error trying to send another object as a p

    This is my error... I will explain it the best I can as it is very important<BR>that I solve this problem.<BR><BR>Microsoft VBScript runtime error &#039;800a000d&#039; <BR><BR>Type mismatch: &#039;select_criteria.AddTitle&#039; <BR><BR><BR><BR>the actual code is - call select_criteria.AddTitle (title,MyErrors)<BR><BR>where AddTitle is a function in select_criteria; which is a class in a ActiveX<BR>DLL successfully created through <BR>set select_criteria = server.createobject("adminpub.select_criteria")<BR ><BR>every other method in adminpub.select_criteria works fine. Except when passing<BR>in a adminerrs.Errors object which has also been successfully created with<BR>a server.createobject command.<BR><BR>set MyErrors = server.createobject("adminerrs.Errors")<BR><BR>I would suspect that it is not the title string in calling AddTitles but<BR>the MyErrors is not working correctly.<BR><BR>The only thing I can think of is that you cannot pass another server object<BR>to another one for some reason...[why, I don&#039;t know]..<BR><BR>These possibilities arose on the MSDN site for type mismatch errors that<BR>seemed pretty close to me...<BR><BR>"You attempted to mix traditional Basic error handling with Variant values<BR>having the Error subtype (10, vbError), "<BR> OR<BR><BR>"At run time, this error typically indicates that a Variant used in an expression<BR>has an incorrect subtype, "<BR><BR><BR>Does every variable AND object become a variant in VBscript?<BR><BR>Can you not send server OBJECTS by reference?<BR><BR>If not, is there a way to get around this w/o changing the called procedure?<BR><BR>What is the way to do this?<BR><BR>If possible contact me at<BR>Thanks much...<BR>

  2. #2
    Join Date
    Dec 1969

    Default *Possibly*...

    ...because your AddTitle function/sub is declared via:<BR><BR>... AddTitle( s AS String, e AS adminerrs.Errors )<BR><BR>But *all* objects (other than Strings) in VBS are treated as Variant. So maybe if you coded<BR><BR>... AddTitle( s AS String, e AS Variant )<BR><BR>and then, in the code for AddTitle, checked to be sure that e was actually the type you were expecting...???<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts