URL in DB's?

Results 1 to 3 of 3

Thread: URL in DB's?

  1. #1
    Join Date
    Dec 1969

    Default URL in DB's?

    How would you get a URL link that is called from a DB? The problem is that they are not all URL&#039;s just a select few and I want them to be "clickable".<BR><BR>Does that make sense???

  2. #2
    Join Date
    Dec 1969

    Default Code

    This code was written by uprightmonkey. It only works if the ENTIRE string is a URL.<BR><BR>strA = "http://www.uprightmonkey.com"<BR>If LEFT(strA,7) = "http://" Then<BR> strB = "&#060;a href=&#039;" & strA & "&#039;&#062;" & strA & "&#060;/a&#062;"<BR>End If<BR>response.write strB

  3. #3
    Join Date
    Dec 1969

    Default RE: URL in DB's?

    Yes it makes sense!<BR><BR><BR>When you say:<BR>--&#062;The problem is that they are not all URL&#039;s just a select few&#060;--<BR>What is the value for the others ?<BR><BR>Or one thing you could do if the select few starts with "http://"<BR>Then you can make a condition.<BR><BR><BR>Dim objConn<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .Open "...."<BR><BR>Dim strSQL<BR>strSQL = "SELECT * FROM Table"<BR><BR>Dim objRecordset<BR>Set objRecordset = Server.CreateObject("ADODB.Recordset")<BR><BR>objR ecordset.Open strSQL, objConn, 3, 2<BR><BR>If objRecordset.RecordCount &#062; 0 Then<BR>&#039;You have some records!<BR>While not objRecordset.EOF<BR>If Left(objRecordset("URLField"),7) &#060;&#062; "http://" Then<BR>&#039;You know it is not a link<BR>Else<BR>&#039;You know it IS a link<BR>End if<BR>objRecordset.MoveNext<BR>Wend<BR>Else<BR>&#0 39;No records found probably EOF<BR>Response.Write "No data"<BR>Response.End<BR>End if<BR><BR>objRecordset.Close<BR>Set objRecordset= nothing<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts