We help IT Professionals succeed at work.

a href=filename

avx asked
Medium Priority
Last Modified: 2006-11-17
A small problem with opening a word document in word.

Im pulling in filenames in the form of C:\mydoc.doc from sql server, looping through the recordset and attempting to attach the filename to the <a href> tag, like so:

while Not RS.Eof
    Response.write "<a href=" & RS("FileName") & ">" & RS("DocName") & "</a>"
RS.movenext: wend

However when the mouse is over the link it shows as follows:
file:///C:/mydoc.doc  and just goes to the 'Page no found'.

What am i doing wrong???

(sorry i only have 25 points!)

Watch Question

If you are using PWS on your machine, you must have the files in the PWS area, or it will access the info from the C Drive. I assume the files will be stored on a server, so they must be stored on the PWS area.

The reason that it is coming up with "Page not found" if you are using PWS is that you are currently connected to the PWS, and are then trying to connect to a file off the PWS, which on a server won't work.
silly man.. if the link is as "c:\..." it would access the Hard disk of the browser.

to over come that, always go for relative path names

for ex.. if the site is hosted in c:\ then just give the URL  as "filename.doc"..

if u have mapped ur site as c:\inetsrv\wwwroot, u will have problem in accessing c:\

so store the article in any directory deeper than the default web site directory

all the best

Explore More ContentExplore courses, solutions, and other research materials related to this topic.