• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

Use ASP Convert_URL in VB6

How do I use the following ASP in VB6 as a string, yet have the asp file display it as a hyperlink?

my <a href=" & <%Convert_ChatURL(' ')%> & ">chat</a> feature

in the browser source code it should read:

my <a href="http://mychatserver/index.htm">chat</a> feature

but I'm getting <a href='<%Convert_ChatURL(' ')%>'>chat</a>
0
matthersjr
Asked:
matthersjr
  • 5
  • 4
  • 3
2 Solutions
 
deighcCommented:
> How do I use the following ASP in VB6 as a string

This doesn't make any sense.

Could you try explaining your problem more clearly.
0
 
snavebelacCommented:
i am not exactly sure what you mean but perhaps this...

my <a href="<%=Convert_ChatURL(' ')%> & ">chat</a> feature

You need to make sure your file extension is .asp and your are running it from a compatiable server (IIS... for example).

post more code if this does not help you

C
0
 
matthersjrAuthor Commented:
I have an asp file that makes a call to a vb6 module that needs to write it as a string in the vb6 code.

strReturn = strReturn & "<a href='<%Convert_ChatURL(' ')%>'>chat</a> "
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
snavebelacCommented:
Assuming Convert_ChatURKL (' ') is in your VB6 module

strReturn = strReturn & "<a href=""<%" & Convert_ChatURL(' ') & "%>"">chat</a> "

I am still not clear but that might do it...

C
0
 
deighcCommented:
You can't have the ASP delimiters (ie. <% and %>) inside a string value. That doesn't make sense.

I'm not clear with what you're doing either. Is the line of code you posted coming from your ASP page or your VB .dll ??
0
 
matthersjrAuthor Commented:
dll

how would I do this in vb6?

<%Convert_ChatURL(' ')%>

0
 
deighcCommented:
Convert_ChatURL() an ASP function or a function in your .dll??
0
 
snavebelacCommented:
Assuming Convert_ChatURL() is returning a formatted URL then..

strReturn = strReturn & "<a href=""" & Convert_ChatURL(' ') & """>chat</a> "

For Example If Convert_ChatURL() return "http://www.google.com" then the final string out put would be

<a href="http://www.google.com">chat</a>


Are we even getting close ?

C
0
 
matthersjrAuthor Commented:
asp function
0
 
deighcCommented:
You can't make any references to your ASP function in the .dll.
So this code in the .dll:

strReturn = strReturn & "<a href=""<%" & Convert_ChatURL(' ') & "%>"">chat</a> "

simply will not work. This will just return a string like this:

<a href="<%Convert_ChatURL(' ')%>">chat</a>

(as you stated in your first post).

You can't have a string value in ASP (ie. the output of your .dll) and execute it as ASP code. This simply isn't possible.

As I see it you have two options:

1. Move the Convert_ChatURL() function into your .dll and build up the full string there.
2. Return two string values from your .dll and append them together in conjunction with the output from Convert_ChatURL()
0
 
snavebelacCommented:
Assuming your dll inserts the string into an ASP script before it is processed

strReturn = strReturn & "<a href=""<%=Convert_ChatURL(' ')%>"">chat</a> "

strReturn will now be equal to

<a href="<%=Convert_ChatURL(' ')%>">chat</a>

which will work in an ASP page where Convert_ChatURL() is an ASp function with a return value.

HTH

C
0
 
deighcCommented:
Actually, you have another option:

Pass the result of Convert_ChatURL() into your .dll and these use it to build up the complete string. This is probably the easiest option. You simply have to add another class property of function argument somewhere in your VB module.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now