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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlinks when bringing in Access2000 recordset

Status
Not open for further replies.

rossmcl

Programmer
Apr 18, 2000
128
Is there anyway of bringing in a hyperlink from Access so it is actually a hyperlink in the table.<br><br>Or ideally, bringing in the hyperlink address, but showing it as a image.<br><br>Thanks IN Advance<br>Ross
 
Assuming that you have already have both the image name and url in a recordset:<br><br>response.write &quot;&lt;a href='&quot; & rs(&quot;url&quot;) & &quot;'&gt;&quot;<br>response.write &quot;&lt;img src='&quot; & rs(&quot;image&quot;) & &quot;'&gt;&lt;/a&gt;&quot; <p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
THE SAGA CONTINUES....<br><br>I AM STARTING TO THINK THERE MUST BE A BETTER WAY OF DOING WHAT I HAVE BEEN GETTING HELP FROM YOU...HOW DO I SPECIFY THE WIDTHS ETC FOR EACH COLUMN. (I WANT ONE OF THE COLUMNS ALSO TO BE A HYPERLINK. SURELY I DONT HAVE TO USE LOADS OF IF STATEMENTS??? (AS I HAVE FOR THE WIDTHS BELOW.<br><br>ALSO HOW DO I LEFT ALIGN MY TITLE HEADERS?<br><br><br>THANKS<br><br>ROSS<br><br>' Continue with a title row in our table<br>Response.Write &quot;&lt;TABLE BORDER=&quot;&quot;0&quot;&quot; CELLSPACING=&quot;&quot;0&quot;&quot; CELLPADDING=&quot;&quot;0&quot;&quot;&gt;&quot; & vbCrLf<br><br>Response.Write vbTab & &quot;&lt;TR&gt;&quot; & vbCrLf<br>For x = 1 To rs.Fields.Count<br>if x = 2 then<br>Response.Write vbTab & vbTab & &quot;&lt;TH width=50&gt;&quot;<br>Else<br>Response.Write vbTab & vbTab & &quot;&lt;TH width=500&gt;&quot;<br>End If<br>Response.Write rs.Fields(x - 1).Name<br>Response.Write &quot;&lt;/TH&gt;&quot; & vbCrLf<br>Next<br>Response.Write vbTab & &quot;&lt;/TR&gt;&quot; & vbCrLf<br><br>' Loop through our records<br>Do While rs.AbsolutePage = strPageCurrent And Not rs.EOF<br>rowcounter = rowcounter + 1<br>if rowcounter/2 = rowcounter\2 then <br>bg=&quot;#A8BDE6&quot;<br>else<br>bg=&quot;white&quot;<br>end if<br>Response.Write &quot;&lt;TR bgcolor=&quot; & bg & &quot;&gt;&quot; & vbCrLf<br>For y = 1 To rs.Fields.Count<br>Response.Write &quot;&lt;TD&gt;&quot;<br>Response.Write rs.Fields(y - 1)<br>Response.Write &quot;&lt;/TD&gt;&quot; & vbCrLf<br>Next<br>Response.Write &quot;&lt;/TR&gt;&quot; & vbCrLf<br><br>'Move to the next record!<br>rs.MoveNext<br>Loop <br>
 
Ross,<br>&nbsp;&nbsp;You can store your column widths in an array, then you don't have to use if statements. For example,&nbsp;&nbsp;ColumnWidths(0) would contain the width for the column that displays rs.fields(0).&nbsp;&nbsp;Then you can do something like<br>response.write &quot;&lt;TH width='&quot; & ColumnWidths(x-1) & &quot;'&gt;&quot;<br><br>I've explained in an earlier post how to include a hyperlink.<br><br>You can align the column headers by using the ALIGN attribute in the &lt;TH&gt; tag:<br><br>&lt;TH ALIGN='LEFT' WIDTH=50&gt; <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
Nick,<br><br>Thanks a lot again,your help is much appreciated as always. Yet again, you have saved the day!<br><br>Using an array has worked a treat, as has the align left. I am struggling with the hyperlink for one column, but slowly getting there.<br><br>Thanks again.<br><br>Ross
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top