Results 1 to 5 of 5

Thread: Using Server.URL in a VB Program

  1. #1
    Guest
    How do I use the Server.URLEncode method (in the ASP Type Library) in a normal VB program?

    I know I've got it on my machine (I've got PWS installed which uses it) and I've added it to my project's references.

    Basically I want to use a line of code like:
    Code:
    sTemp = Server.URLEncode(txtMessage)

    I'm using this sotra code to set it up:
    Code:
    Dim objURLFix As Server
        Set objURLFix = CreateObject("Server")
    But I can't get it to work... I either get an error about ActiveX not being able to create the (Server) object, or object variable or with block not set.

    So come on guys...what's the correct syntax to declare the server object?

  2. #2
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281
    This is the way to create a server object:
    Code:
    dim objURLFix
    
    set objURLFix = server.CreateObject("TypeOfObjectToCreate")
    However, I think you can use
    Code:
    server.urlEncode("String")
    without creating an instance of it first.


    [Edited by compuGEEK on 08-04-2000 at 05:10 PM]

  3. #3
    Guest
    No, that's not what I mean. You've described how to create ActiveX objects in an ASP page. I can do that. That's fine.

    I'm not using ASP here tho. I'm in proper VB, but I want to use the "Server.URLEncode" method in the ASP Type Library.

    I'm creating a standalone exe program that submits information to a cgi script on a website.

    I want to use the Server.URLEncode method to make sure there are no illegal characters in the in the querystring I send to the script.

    So basically I'm trying to create an instance of the Server object in a proper VB program.

  4. #4
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281
    Oh...I see. Sorry!

  5. #5
    New Member
    Join Date
    Nov 2000
    Posts
    12

    Using Server.URL in a VB Program

    I am not really sure..
    But I think you should reference the Microsoft Active Server page Object in VB at Menu item PROJECT/REFERENCES
    and check on MICROSOFT ACTIVE SERVER PAGE OBJECT LIBRARY.

    After referenceing the ASP object Lib...you can then use the server object..like
    Server.CreateObject(".....") etc.

    If it works something for you, I would like to hear about it.




    [Edited by DavidBG on 11-21-2000 at 10:15 AM]
    David

Posting Permissions

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



Click Here to Expand Forum to Full Width