part ASP part VB problem


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: part ASP part VB problem

  1. #1
    Walt Phillips Guest

    part ASP part VB problem


    This is my error... I will explain it the best I can as it is very important
    that I solve this problem.

    Microsoft VBScript runtime error '800a000d'

    Type mismatch: 'select_criteria.AddTitle'



    the actual code is - call select_criteria.AddTitle (title,MyErrors)

    where AddTitle is a function in select_criteria; which is a class in a ActiveX
    DLL successfully created through
    set select_criteria = server.createobject("adminpub.select_criteria")

    every other method in adminpub.select_criteria works fine. Except when passing
    in a adminerrs.Errors object which has also been successfully created with
    a server.createobject command.

    set MyErrors = server.createobject("adminerrs.Errors")

    I would suspect that it is not the title string in calling AddTitles but
    the MyErrors is not working correctly.

    The only thing I can think of is that you cannot pass another server object
    to another one for some reason...[why, I don't know]..

    These possibilities arose on the MSDN site for type mismatch errors that
    seemed pretty close to me...

    "You attempted to mix traditional Basic error handling with Variant values
    having the Error subtype (10, vbError), "
    OR

    "At run time, this error typically indicates that a Variant used in an expression
    has an incorrect subtype, "


    Does every variable AND object become a variant in VBscript?

    Can you not send server OBJECTS by reference?

    If not, is there a way to get around this w/o changing the called procedure?

    What is the way to do this?

    If possible contact me at turboswitch@yahoo.com
    Thanks much...

  2. #2
    Russell Jones Guest

    Re: part ASP part VB problem

    You're on the right track.

    > Does every variable AND object become a variant in VBscript?

    Yes.

    Try this:
    call select_criteria.AddTitle(cstr(title), MyErrors)

    Russell Jones
    Sr. Web Development Editor,
    DevX.com

    "Walt Phillips" <turboswitch@yahoo.com> wrote in message
    news:3b54bbff$1@news.devx.com...
    >
    > This is my error... I will explain it the best I can as it is very

    important
    > that I solve this problem.
    >
    > Microsoft VBScript runtime error '800a000d'
    >
    > Type mismatch: 'select_criteria.AddTitle'
    >
    >
    >
    > the actual code is - call select_criteria.AddTitle (title,MyErrors)
    >
    > where AddTitle is a function in select_criteria; which is a class in a

    ActiveX
    > DLL successfully created through
    > set select_criteria = server.createobject("adminpub.select_criteria")
    >
    > every other method in adminpub.select_criteria works fine. Except when

    passing
    > in a adminerrs.Errors object which has also been successfully created with
    > a server.createobject command.
    >
    > set MyErrors = server.createobject("adminerrs.Errors")
    >
    > I would suspect that it is not the title string in calling AddTitles but
    > the MyErrors is not working correctly.
    >
    > The only thing I can think of is that you cannot pass another server

    object
    > to another one for some reason...[why, I don't know]..
    >
    > These possibilities arose on the MSDN site for type mismatch errors that
    > seemed pretty close to me...
    >
    > "You attempted to mix traditional Basic error handling with Variant values
    > having the Error subtype (10, vbError), "
    > OR
    >
    > "At run time, this error typically indicates that a Variant used in an

    expression
    > has an incorrect subtype, "
    >
    >
    > Does every variable AND object become a variant in VBscript?
    >
    > Can you not send server OBJECTS by reference?
    >
    > If not, is there a way to get around this w/o changing the called

    procedure?
    >
    > What is the way to do this?
    >
    > If possible contact me at turboswitch@yahoo.com
    > Thanks much...




  3. #3
    Walt Phillips Guest

    Re: part ASP part VB problem


    Thanks for the help, although it didn't quite work...

    I think the problem is with MyErrors, a successfully instantiated class from
    the adminerrs.Errors object... Anyway, if it is the case that everything
    is turned into a variant, why is it that some variables and objects work
    fine w/o having to change them and others don't i.e. MyErrors?

    The object was created just fine, so why all the problem?

    Any other clues on not having this type mismatch snafu?

    I double checked to make sure that it was the same class I was sending it
    that it needed.

    "Russell Jones"
    >You're on the right track.
    >
    >> Does every variable AND object become a variant in VBscript?

    >Yes.
    >
    >Try this:
    >call select_criteria.AddTitle(cstr(title), MyErrors)
    >



  4. #4
    Russell Jones Guest

    Re: part ASP part VB problem

    Post the parameter types for the call to the select_Criteria.Add method.


    "Walt Phillips" <turboswitch@yahoo.com> wrote in message
    news:3b55ec84$1@news.devx.com...
    >
    > Thanks for the help, although it didn't quite work...
    >
    > I think the problem is with MyErrors, a successfully instantiated class

    from
    > the adminerrs.Errors object... Anyway, if it is the case that everything
    > is turned into a variant, why is it that some variables and objects work
    > fine w/o having to change them and others don't i.e. MyErrors?
    >
    > The object was created just fine, so why all the problem?
    >
    > Any other clues on not having this type mismatch snafu?
    >
    > I double checked to make sure that it was the same class I was sending it
    > that it needed.
    >
    > "Russell Jones"
    > >You're on the right track.
    > >
    > >> Does every variable AND object become a variant in VBscript?

    > >Yes.
    > >
    > >Try this:
    > >call select_criteria.AddTitle(cstr(title), MyErrors)
    > >

    >




  5. #5
    Walt Phillips Guest

    Re: part ASP part VB problem



    >Post the parameter types for the call to the select_Criteria.Add method.


    Public Function AddTitle(pub_title As String, MyErrors As adminerrs.Errors)

    I've tried the ByRef stuff and that didn't work. What I ended up doing was
    going into the component and just taking out the 'MyErrors As adminerrs.Errors'
    because I suppose I can handle the errors in the script. Although this is
    an extrememly shortcut way of doing this as I don't want to have to do this
    in EVERY class in the EVERY DLL that I am going to use. It seems to work
    although that destroys the robustness of the program.

  6. #6
    Russell Jones Guest

    Re: part ASP part VB problem

    No. Just change it to:
    Public Function AddTitle(pub_title As Variant, MyErrors As Variant)
    ' add type checks here to ensure proper types passed
    ' code you already have...
    End Function

    "Walt Phillips" <turboswitch@yahoo.com> wrote in message
    news:3b575191$1@news.devx.com...
    >
    >
    > >Post the parameter types for the call to the select_Criteria.Add method.

    >
    > Public Function AddTitle(pub_title As String, MyErrors As

    adminerrs.Errors)
    >
    > I've tried the ByRef stuff and that didn't work. What I ended up doing

    was
    > going into the component and just taking out the 'MyErrors As

    adminerrs.Errors'
    > because I suppose I can handle the errors in the script. Although this is
    > an extrememly shortcut way of doing this as I don't want to have to do

    this
    > in EVERY class in the EVERY DLL that I am going to use. It seems to work
    > although that destroys the robustness of the program.




  7. #7
    Walt Phillips Guest

    Re: part ASP part VB problem


    Yeah, that'll work. I was just hoping that I wouldn't have to change the
    code in the the DLL. Because there are a lot functions that I will have
    to do that with. But if that's the case... oh well.

    It would seem from the multitude of responses I have that this would be the
    only way to do it. I was just thinking that maybe there was some super secret
    hacker way of circumventing this problem... The DLLs I didn't write, I'm
    just makig a web shell for a program that exists already.

    Thanks for your help,

    Walt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center