homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

Keeping Links Intact in Access DB

 7:28 pm on Nov 18, 2010 (gmt 0)

Hi Everyone,

I have an access DB created in Access 2007 and saved in Access 2003 (.mdb). The tables contain links to a file server on my internal network. I'm trying to import the db into Expression Web 4 and keep the links intact. Currently, I can get the import to work, but the links get stripped out and displayed as plain text.

Any ideas?




 4:24 am on Nov 19, 2010 (gmt 0)

I beleive the hyperlink field you are talking about is treated as a string value via data access objects, and would come out as a simple plain text. You will have to just create the hyperlink in the Asp.net code using this plain string in the href value.

Example without data binding to keep it easy to read where "value" is the hyperlink text from the database
<a href="<%=value%>"><%=value%></a>


 6:08 pm on Nov 19, 2010 (gmt 0)

Hi Ocean1000,

I'm new to .Net, so I apologize in advance for any ignortant questions. :) Here is what my code looks like so far:

<asp:DataList id="DataList1" runat="server" CellPadding="4" DataSourceID="AccessDataSource1" ForeColor="#333333" RepeatColumns="1">
<AlternatingItemStyle BackColor="White" />
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<ItemStyle BackColor="#E3EAEB" />
<asp:Label id="LogosLabel" runat="server" Text='<%# Eval("Logos") %>' />
<asp:Label id="DownloadLabel" runat="server" Text='<%# <a href="<%=Download%>"<%=Download%></a> %' />
<br />
<br />
<SelectedItemStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="Marketing-Files.mdb" SelectCommand="SELECT [Logos], [Download] FROM [Logos]">

This Produces a column with 1 field and a column with =%

So, it looks like this:

Logo 1 =%

The desired result would be:

Logo 1 DOWNLOAD (where DOWNLOAD is a hyperlink)

Thanks for your help!


 6:38 pm on Nov 19, 2010 (gmt 0)

I think this is what you are trying to achieve.

<asp:Image runat="server" ImageUrl='<%# Eval("Logos") %>' />
<asp:HyperLink runat="server"
NavigateUrl='<%# Eval("Download", "{0}") %>' Text='Download'></asp:HyperLink>
<br />
<br />


 6:55 pm on Nov 19, 2010 (gmt 0)

I think we're getting closer.

The code above includes an image. I'd just like to pull text from my db in that column. ie. Logo 1 (followed by the download link.)

The hyperlink is pointing here:


How do I define the link from the db?



 9:57 pm on Nov 19, 2010 (gmt 0)

ok, I noticed I had an error in my Access db that was causing the URL to display incorrectly. After fixing the error, I'm now getting a double URL. ie:



 10:08 pm on Nov 19, 2010 (gmt 0)

And to fix the image issue described above I just replaced the image code with:

<asp:Label id="LogosLabel" runat="server" Text='<%# Eval("Logos") %>' />

Everything is working great except for the double URL.

Any ideas on that one?


 12:02 am on Nov 30, 2010 (gmt 0)

Any ideas on this?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved