Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to using server.URLEncode at visual basic 6.0

Posted on 2001-06-02
9
Medium Priority
?
1,432 Views
Last Modified: 2013-11-25
hi
How to using server.URLEncode at visual basic 6.0

thank
0
Comment
Question by:kwq5421
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 6

Expert Comment

by:sharmon
ID: 6149952
If you are making a IIS application it should already be available to you.  If not you may want to look at this function that someone has already written, that will do it for you.  Here is the link...

http://www.planet-source-code.com/xq/ASP/txtCodeId.3229/lngWId.1/qx/vb/scripts/ShowCode.htm
0
 
LVL 1

Author Comment

by:kwq5421
ID: 6150037
Can i using the vbscript server.urlencode at vb source code ? thank ..
0
 
LVL 1

Author Comment

by:kwq5421
ID: 6150051
Can i using the vbscript server.urlencode at vb source code ? thank ..
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:kwq5421
ID: 6150093
Can i using the vbscript server.urlencode at vb source code ? thank ..
0
 
LVL 1

Expert Comment

by:jdunck
ID: 6150741
Server.URLEncode is not part of VBScript.

The Server object is part of ASP...-not- part of VB.

Understand that methods of objects are part of that object, -not- part of the language you happen to be programming in.

ASP can be written in JavaScript just as easily, and COM objects can be used by any language that supports COM (C++, VC++, VB, Java, I think).
0
 
LVL 6

Accepted Solution

by:
sharmon earned 30 total points
ID: 6150895
Add a reference to Microsoft ASP library in your project and it will expose Server, Session, etc...but they will not work unless they are passed from a real Session on a IIS server into your project.  You cannot set them to new objects.  I do not know the reasoning behind it as I have never looked into it.  I haven't ever had a need to use the ASP object library without a IIS Server.  
0
 
LVL 6

Expert Comment

by:andyclap
ID: 6151907
It's not actually a very difficult function, you could write your own along the lines of:

Public Function URLEncode(ByVal s As String) As String

    Dim lLoop As Long
    Dim sC As String

    URLEncode = ""
    For lLoop = 1 To Len(s)
        sC = Mid$(s, lLoop, 1)
        If InStr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", UCase$(sC)) = 0 Then
            If Asc(sC) < 16 Then
                sC = "%0" & Hex$(Asc(sC))
            Else
                sC = "%" & Hex$(Asc(sC))
            End If
        End If
       
        URLEncode = URLEncode & sC
    Next
   
End Function
0
 
LVL 1

Expert Comment

by:jdunck
ID: 6152378
AndyClap --
  Its true that the specs aren't hard to handle, but since the original question was so far off the mark, I was trying to explain what he was really asking.
  Trying to use an ASP-created object as an intrinic property of VB begs for clarification.
0
 
LVL 6

Expert Comment

by:sharmon
ID: 6199533
If you didn't like the responses you had gotten from us so far, you should have requested a deletion of the question or held out for whatever you were looking for.  This is the third time someone I responded who couldn't do what they were asking for and I told them that, and gotten a grade of C for it.  I would have rather not helped you at all.  I don't think I'll be responding to questions that do not have a valid answer anymore.  There were two answers to this, one You Cant Include the ASP Object Library in a VB Stand Alone Application, or write your own replacement function.  You have gotten both of them from me, and another from Andy.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question