Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

with entire URL string as variable, pound signs remain

Status
Not open for further replies.

simmerdown

Programmer
Jun 6, 2000
100
US
<br>the code:<br>_________________________________________<br><br><FONT FACE=monospace>&lt;cfquery datasource=&quot;rtk&quot; name=&quot;link&quot;&gt;<br>&nbsp;&nbsp;SELECT URL<br>&nbsp;&nbsp;FROM CAS<br>&nbsp;&nbsp;&nbsp;WHERE CASnumber LIKE '#URL.CAS#'<br>&nbsp;&lt;/cfquery&gt;<br><br>&lt;b&gt;&lt;cfoutput&gt;&lt;a href=&quot;#link.URL#&quot;&gt;MSDS information&lt;/a&gt;&lt;/cfoutput&gt;&lt;/b&gt;</font><br>_________________________________________<br><br>So what's my problem? Well, the intended link is generated in the processed page, but for some strange reason it still has the pound signs around the URL string. (ColdFusion should take 'em right out, of course.) With the pound signs still there, the generated link is non-functional.<br>Anyone seen this happen before?<br>A fix would be much appreciated.
 
You must name your cfoutput if it comes from a query.<br><br>Try:<br><br>&lt;cfquery datasource=&quot;rtk&quot; name=&quot;link&quot;&gt;<br>&nbsp;&nbsp;SELECT URL<br>&nbsp;&nbsp;FROM CAS<br>&nbsp;&nbsp;&nbsp;WHERE CASnumber LIKE '#URL.CAS#'<br>&nbsp;&lt;/cfquery&gt;<br><br>&lt;b&gt;&lt;cfoutput query=&quot;link&quot;&gt;&lt;a href=&quot;#link.URL#&quot;&gt;MSDS information&lt;/a&gt;&lt;/cfoutput&gt;&lt;/b&gt;<br><br>It should work just fine.
 
Well, that's true and not true...<br><br>You will need to name your query if and only if you are going to generate a list of items.&nbsp;&nbsp;If you're returning only one value, it's appropriate to simply scope your variable by adding it's query name infront (i.e. #link.url#)<br><br>Why the pound signs are remaining in your example is strange, you're not using &quot;double&quot; pound signs at all are you, I know that seems silly, but it will throw everything off... <br><br>Your example should work perfectly...&nbsp;&nbsp;Sometimes when I get an oddball error like this one, it helps to delete the entire thing and start over... it almost ALWAYS helps...<br><br>Good luck... <p>Shane Vossen<br><a href=mailto:svossen@vortexsolutions.com>svossen@vortexsolutions.com</a><br><a href= Scotland</a><br>
 
I also hit the Allaire message boards, and the solution was found. It turns out that it's not a ColdFusion anomaly at all ... my Access database was sticking in the extra pound signs.<br>Access includes pound signs around the content of a database field when that field is specified as a Hyperlink. If you just format it as Text, the magically appearing pound signs are no more.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top