|
-
Aug 3rd, 2000, 07:18 AM
#1
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?
-
Aug 4th, 2000, 03:40 PM
#2
Hyperactive Member
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]
-
Aug 5th, 2000, 05:20 AM
#3
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.
-
Aug 7th, 2000, 10:06 AM
#4
Hyperactive Member
-
Nov 20th, 2000, 09:20 AM
#5
New Member
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]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|