Solved

Retrieve URL from database

Posted on 2003-10-30
8
154 Views
Last Modified: 2012-05-04
I have a simple website that has some dynamic pages.  The pages load the names of forms and other documents that are stored in an Access database.  I also have in the database location of each form or document on the network.  What I am trying to do is hyperlink to the location specified in the database.


Example:

My Forms.asp page loads the names of each form stored in the database when opened.  When the user clicks on one of these form names, I want to open that form using the path that is also stored in the database.  How would I do that?  I am using Dreamweaver MX with ASP and MS Access.

If this is not clear, let me know and I will try to clarify.

Thanks.
0
Comment
Question by:sre22
  • 4
  • 4
8 Comments
 
LVL 23

Expert Comment

by:adilkhan
Comment Utility
You have something Like page1.asp Stored in Database?

if thats the Case then simplly Follow the Given Example.

<a href="<%=rs("field_url")%>"><%=rs("field_url")%></a>

if I am not Clear or you are confused let me know so i can Assist you in a better way.
0
 

Author Comment

by:sre22
Comment Utility
Here is what I have:

An access database with a table called "Files".  The table has these fields:

FileName  (Example: "Employee Computer Manual")
FileDescription (Example: "Computer Manual explaining how to use various software programs and applications")
FileLocation (Example: "I:\Manuals\Computer Manual.doc")

In my website (which is actually an Intranet) i have a page called Forms.asp that dynamically displays all the FileNames and FileDescriptions that are in my Access database.  That part works fine.  It lists each FileName and description as I wanted.  But my problem is that I want to be able to link to the actual file (Word doc, Excel, etc...) so that when the user clicks on a FileName that is displayed on Forms.asp, it will open the file by using the field in the database "FileLocation".

Maybe there is an easier way to do this so I'm open to suggestions, but this was the best way I could think of.  Hopefully this clears things up.
0
 
LVL 23

Expert Comment

by:adilkhan
Comment Utility
You Doing Good.

Where you printing File Names Do this
imagine these fields equall to your Fields in Database.

file_name = rs("file_name")
file_loc = rs("file_loc")

imagine this this in the LOOP That Prints all the File Names on your Page

<%=file_name%>

so to Link it to the Location

<a href="<%=file_loc%>">    <%=file_name%>  </a>

Did That Make Sense?
0
 

Author Comment

by:sre22
Comment Utility
ok.  I think I understand.  I am just learning Dreamweaver but still don't know very much html.  I created the dynamic data using a record set and I believe this is the code where it loads the data from the database:

While ((Repeat1__numRows <> 0) AND (NOT MGInfoForms.EOF))
%>
    <tr>
      <td width="302"><%=(MGInfoForms.Fields.Item("FileName").Value)%></td>  
      <td width="575"><%=(MGInfoForms.Fields.Item("FileDescription").Value)%></td>
    </tr>
    <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  MGInfoForms.MoveNext()
Wend

so using this, where would I put in your code?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 23

Accepted Solution

by:
adilkhan earned 100 total points
Comment Utility
> <td width="302"><%=(MGInfoForms.Fields.Item("FileName").Value)%></td>  

do this

 <td width="302"><a href="<%=MGInfoForms.Fields.Item("FileLocation").Value%>"><%=(MGInfoForms.Fields.Item("FileName").Value)%></a></td>  
0
 

Author Comment

by:sre22
Comment Utility
Thank you so much!!!

I'm sure I'll have some more questions for you soon :)
0
 
LVL 23

Expert Comment

by:adilkhan
Comment Utility
Always Feels Good to help someone:).
Sure Bring it on.
0
 

Author Comment

by:sre22
Comment Utility
ok.  posting a follow up to this one.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now