473,651 Members | 3,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hyperlink walkthrough

I am trying to go through a list of files in a folder and then add a
hyperlink to each one in a table.

I am having a difficult time figuring out how to add that link into the
table and do it in such a way that the entire path isn't displayed in
the record, just the document name (just like I can make it look if I
add the hyperlink by hand and then edit it using the dialog.)

I have tried figuring it out using this article: (but I still don't get
it)
http://msdn.microsoft.com/archive/de...plications.asp

Could someone kindly walk me through how to get from having a String
with my file path stored in it, to adding it to my table, such that the
link only displays the document name and not the full path?

Thank you,

Jody Blau

Jan 30 '06 #1
2 1758
It would be easier to makit specific for you if we knew your table tructure
but here's an example which will hopefully make som sense.

The table structure I used or this example was
tlHyperLink
---------------
Name DataType
ID AutoNumber
File Hyperlink

The following actually adds the value to th table:-

Sub AddHyperLink( _
Tablename As String, _
FieldName As String, _
Hyperlink As String, _
DisplayText As String _
)
Dim db As DAO.Database
Dim strValue As String
Dim strSQl As String

Const ELEMENT_SEP = "#"

If Len(DisplayText ) < 1 Then
DisplayText = Hyperlink
End If

strValue = DisplayText & ELEMENT_SEP & Hyperlink & ELEMENT_SEP

strValue = Replace(strValu e, "'", "''", Compare:=vbText Compare)

strSQl = "INSERT INTO [" & Tablename & "] ([" _
& FieldName & "]) VALUES ('" _
& strValue & "')"

CurrentDb.Execu te strSQl
End Sub

The following is an example of adding the entire contentsof a folder

Function wut()
Dim strFile As String
Const FOLDER_PATH = "D:\Projects\Pi nnacle\Tools\Au tomation
Wizard\Audit\"

strFile = Dir(FOLDER_PATH & "*.txt")
Do While Len(strFile) > 0
Call AddHyperLink("t lHyperLink", "File", FOLDER_PATH & strFile,
strFile)
strFile = Dir
Loop
End Function
If you have one filename you could do the folloing
Call AddHyperLink("t lHyperLink", "File", YourFileName,
Dir(YourFileNam e))


--

Terry Kreft
"jodyblau" <jo******@gmail .com> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.com...
I am trying to go through a list of files in a folder and then add a
hyperlink to each one in a table.

I am having a difficult time figuring out how to add that link into the
table and do it in such a way that the entire path isn't displayed in
the record, just the document name (just like I can make it look if I
add the hyperlink by hand and then edit it using the dialog.)

I have tried figuring it out using this article: (but I still don't get
it)
http://msdn.microsoft.com/archive/de...plications.asp
Could someone kindly walk me through how to get from having a String
with my file path stored in it, to adding it to my table, such that the
link only displays the document name and not the full path?

Thank you,

Jody Blau

Jan 30 '06 #2
That worked great, thank you so much.
Jody Blau

Jan 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1654
by: Deltones | last post by:
Hi all, I'm just getting into Python/wxPython/Pythoncard and I'm trying the tutorial from this page: http://pythoncard.sourceforge.net/walkthrough1.html Is it me who's totally dense or there's some sort of confusion with this tutorial? Here's what is said in the tutorial:
1
3374
by: Badboy36 | last post by:
Hello user from googlegroups, i made a microsoft access database with front and backend. i created the backend in microsoft access97. for the frontend i made two versions (one for microsoft access 97 and the other one for microsoft acess 2000/2002). my problem is in a field with a hyperlink , which i selected in a table. this hyperlink refer to microsoft word documents on our intranet. i enter the hyperlink in a formular (right...
0
550
by: Ryan Harvey | last post by:
Hi all, I have written a web user control that contains a repeater control. the ItemTemplate for this control is basically 6 Hyperlinks in a row, that are dynamically allocated one of 7 gif images as the ImageURL of the Hyperlink. When a load the page with the controls on it works fine, but sometimes the images are broken, but if i hit refresh i get random selections of the gifs appearing and not appearing. if i hit Back button to a page...
5
6685
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below but here is the snippet of my asp:hyperlink object; <asp:HyperLink NavigateUrl="authonly/clientdetails.aspx?searchID="+<%#DataBinder.Eval(Conta iner.DataItem,"CLIENTREF")%> ID="Hyperlink1"><%#DataBinder.Eval(Container.DataItem,...
5
4609
by: Tarun Mitra | last post by:
I have not been able pass the parameter with a space in an hyperlink on a ..aspx page something like <asp:HyperLink NavigateUrl="http://localhost/syskiosk/test.exe John" id="hlEditDetails" runat="server">Edit Details </asp:HyperLink> I need to know if it is possible to pass parameters to a windows .exe application through a Hyperlink? If yes then what is the best way of doing this. I also tried to pass the parameter by using a ? in...
0
2036
by: Amrit Kohli | last post by:
I am trying to get through the XML Web Services Walkthrough at this location: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vbwlkwalkthroughbuildingwebservicewithmanagedcode.asp Everything seems to work fine. Here’s the code from Service1.asmx.cs : using System; using System.Collections; using System.ComponentModel; using System.Data;
9
2422
by: dennist685 | last post by:
Walkthrough: Creating a Web Page to Display Access Database Data I've started the above walkthrough. However, near the beginning it gives the following instructions To set permissions in the App_Data folder In Windows Explorer, move to the root folder for the Web site. The default location for your new Web site is c:\inetpub\wwwroot\AccessSample.
7
1500
by: John D'oh | last post by:
Hello, I have been going through the MSDN Walkthrough: Creating a Windows Forms Control That Takes Advantage of Visual Studio Design-Time Features. Everything was going fine and I was able to create and compile the MarqueeControlLibrary project. And I think I even understood most of it.
20
2989
by: tshad | last post by:
I had posted this problem earlier and just noticed that the Hyperlink is the problem. Apparently, it doesn't figure out the path correctly. It uses the path of the file it is in, even if it is a control. I have 2 files "displayCompanyJobs.aspx" and "displayCompanyOverview.aspx" which are in both the folder "/jobseeker/" and "/employer/". I have a user control "displayCompanyJobs.ascx" that is in my /applicant/
0
8361
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8278
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8807
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7299
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5615
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1912
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.