this is totally as a sidenote:
Stigmata's extra encoding function is indeed what I meant with the extra checking/validating that needs to be done (although it misses many other special characters). Anyways, the Encode function as Stigmata posted it, can be made much more efficient and smaller
1) to begin with loose the sAsc variable. Great for explanation, but it is only used once and directly in the IF THEN ELSE, so no need for that.
2) No need for getting the ascii value of the character and comparing it to 32, if you can directly compare the character itself to a space (although, this is some clock ticks slower, the code is much shorter)
3) No need to slowly build a new string again when you're only replacing individual characters. You can directly replace them in the original string.
4) Loose the ByVal. ByVal's are very slow compared to ByRef's (with a ByVal, VB needs to create another instance of the variable). To overcome writing over the original variable you can directly manipulate the function's output string.
5) Longs work faster than Integers (in this case) so declare I as a long...
So we get:
code:
Public Function Encode(s As String) As String
Dim I As Long
Encode = s
For I = 1 To Len(Encode)
If Mid$(Encode, I, 1) = " " Then
Mid$(Encode, I, 1) = "+"
End If
Next I
End Function
But hey, isn't that simply replacing every space with a "+"? Well yes, so... simply use VB's Replace function:
[code]Replace(URLString, " ", "+")
PS: nevertheless, you must make an "Encode" routine anyways, to encode your text into the proper characters and "escape codes" (forgot the correct name for them) so you can use them in URLs...
EDIT: Mike, you're late
hihi