Solved

Retrieve URL from database

Posted on 2003-10-30
8
159 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 9655247
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
ID: 9655467
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:Saqib Khan
ID: 9655527
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:sre22
ID: 9655559
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
 
LVL 23

Accepted Solution

by:
Saqib Khan earned 100 total points
ID: 9655568
> <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
ID: 9655605
Thank you so much!!!

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

Expert Comment

by:Saqib Khan
ID: 9655608
Always Feels Good to help someone:).
Sure Bring it on.
0
 

Author Comment

by:sre22
ID: 9655618
ok.  posting a follow up to this one.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Populate Second Select List based on value in first select list. 3 1,595
FINDNOCASE 2 567
Multi Step Form using jQuery 11 959
Editing PHP within Adobe DreamWeaver 11 188
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

696 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