This topic is locked

hyperlink referring to ID Autonumber

3/3/2004 7:05:11 AM
ASPRunnerPro General questions
author

Hi

I was wondering if anyone could save me time when entering into my database. One of the fields in the table I'm going to use is "ID" (it's an autonumber field). Another field is a hyperlink to an avi file.
When the ID number is "34" (for example) I want it to point to an avi file called "34.avi" on a location on my server. At the moment I have a default hyperlink of "http://localhost/videos/"; and the plan was to type 34.avi at the end depending in the ID number but because the add page doesn't show the autonumber it's like having to do the job twice!

Sergey Kornilov admin 3/4/2004

Dave,
probably you can make your life easier by adding calculated field to the SQL query. Here is what you can do:

select ID,

...,

'< a href="http://localhost/'; + CStr(ID) + '.avi">See video</a>' as VideoLink

from Table


Here is the sample data this SQL query should return:

ID ... VideoLink

-------------------------------------------------------------------

33 ... <a href="http://localhost/33.avi">See video</a>

34 ... <a href="http://localhost/34.avi">See video</a>

35 ... <a href="http://localhost/35.avi">See video</a>
after that you just need to display VideoLink field on the list page. This is it.

501028 3/7/2004

Thanks for that. You've saved me a lot of time!