Professional Web Applications Themes

Type Declaration in asp and VB - ASP Components

Have you tried this Public Sub getStandard(Byval strODBC As String, ByVal strHTML As String) Define your parameters passed by value? Maybe it helps, and it is faster. Mert "Sven" <japp66hotmail.com> wrote in message news:055201c37cac$8f3043f0$a401280aphx.gbl... > Hi all! > > Why doesnt this work? > In an .asp page i call for a VB6 function like this: > Set oPage = server.CreateObject("tool.templates") > oPage.getStandard Cstr(strODBC),CStr(strHTML) > Response.Write strHTML > > The strHTML is a return variable. > > The Function in VB is declared like this: > Public Sub getStandard(strODBC As String, strHTML As > String) > > When it returns ...

  1. #1

    Default Re: Type Declaration in asp and VB

    Have you tried this

    Public Sub getStandard(Byval strODBC As String, ByVal strHTML As
    String)

    Define your parameters passed by value?

    Maybe it helps, and it is faster.

    Mert

    "Sven" <japp66hotmail.com> wrote in message
    news:055201c37cac$8f3043f0$a401280aphx.gbl...
    > Hi all!
    >
    > Why doesnt this work?
    > In an .asp page i call for a VB6 function like this:
    > Set oPage = server.CreateObject("tool.templates")
    > oPage.getStandard Cstr(strODBC),CStr(strHTML)
    > Response.Write strHTML
    >
    > The strHTML is a return variable.
    >
    > The Function in VB is declared like this:
    > Public Sub getStandard(strODBC As String, strHTML As
    > String)
    >
    > When it returns to the asp page nothing is "printed"
    > If i declare strHTML as a Variant in VB and removes the
    > CStr() function in the .asp page, it works fine.
    >
    > If i look at strHTML in VB before it returns it looks fine
    > (when i use String)
    >
    > Please help
    >

    Mert sakarya Guest

  2. #2

    Default Re: Type Declaration in asp and VB

    Hi.
    The reason i have for changing the type from Variant to
    String is that i downloaded a code advisor (from
    Microsoft), that checks VB6 code for errors that can occur
    when upgrading to .Net.

    It suggests that i should change all Variants to early
    binding types.

    What happends when i upgrade and some types still are
    Variants?

    >-----Original Message-----
    >"Sven" <japp66hotmail.com> wrote in message
    >news:055201c37cac$8f3043f0$a401280aphx.gbl...
    >> Hi all!
    >>
    >> Why doesnt this work?
    >> In an .asp page i call for a VB6 function like this:
    >> Set oPage = server.CreateObject("tool.templates")
    >> oPage.getStandard Cstr(strODBC),CStr(strHTML)
    >> Response.Write strHTML
    >>
    >> The strHTML is a return variable.
    >>
    >> The Function in VB is declared like this:
    >> Public Sub getStandard(strODBC As String, strHTML As
    >> String)
    >>
    >> When it returns to the asp page nothing is "printed"
    >> If i declare strHTML as a Variant in VB and removes the
    >> CStr() function in the .asp page, it works fine.
    >>
    >> If i look at strHTML in VB before it returns it looks
    fine
    >> (when i use String)
    >
    >ASP only supports "Variant", so the general rule is to
    only pass that type
    >in and out of components.
    >[url]http://support.microsoft.com/default.aspx?scid=kb;en-[/url]
    us;244012
    >
    >--
    >Tom Kaminski IIS MVP
    >[url]http://www.iistoolshed.com/[/url] - tools, scripts, and
    utilities for running IIS
    >[url]http://mvp.support.microsoft.com/[/url]
    >[url]http://www.microsoft.com/windowsserver2003/community/cente[/url]
    rs/iis/
    >
    >
    >
    >.
    >
    Sven Guest

  3. #3

    Default Type Declaration in asp and VB

    Thanks for your help.

    I changed it to be ByVal but nothing is "printed"...
    I have a lot of errorcontrolls in my VB but none trapps
    this one.

    If i "view sourse" of the asp page after the strHTML has
    returned. This is whats there.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=Content-Type content="text/html;
    cht=windows-1252"></HEAD>
    <BODY></BODY></HTML>

    Thats code that i havent put there, think it comes from IE
    when somethings wrong.?.
    >-----Original Message-----
    >>The Function in VB is declared like this:
    >>Public Sub getStandard(strODBC As String, strHTML As
    >>String)
    >
    >When you omit the reference type from VB it defaults to
    >ByRef and ASP can only pass Variants ByRef. When you
    >explicitly state ByVal;
    >
    >Public Sub getStandard(ByVal strODBC As String, ByVal
    >strHTML As String)
    >
    >Then you can pass typed values from ASP. It is also
    >better for performance. If you really need your
    >parameters to be ByRef (ie you want the code inside your
    >function to update the parameter values and you want the
    >calling code to see those values) then you'll need to
    make
    >them Variant in the VB function also.
    >
    >>
    >>When it returns to the asp page nothing is "printed"
    >>If i declare strHTML as a Variant in VB and removes the
    >>CStr() function in the .asp page, it works fine.
    >>
    >>If i look at strHTML in VB before it returns it looks
    >fine
    >>(when i use String)ByVal
    >>
    >>Please help
    >>
    >>.
    >>
    >.
    >
    Sven Guest

Similar Threads

  1. #39220 [NEW]: type in html.c proto declaration
    By jeffg at activestate dot com in forum PHP Bugs
    Replies: 3
    Last Post: October 20th, 09:09 PM
  2. Declaration of myPrincipal
    By david in forum ASP.NET Security
    Replies: 2
    Last Post: April 7th, 07:35 PM
  3. Declaration
    By Sven in forum ASP Components
    Replies: 2
    Last Post: October 1st, 11:58 PM
  4. Class Declaration
    By Kevin Spencer in forum ASP.NET General
    Replies: 2
    Last Post: July 18th, 06:53 PM
  5. Type Declaration Error
    By Austin Bike in forum Microsoft Access
    Replies: 2
    Last Post: July 16th, 08:40 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139