|
-
Nov 14th, 2002, 02:35 PM
#1
Thread Starter
Addicted Member
Hyperlinks
Hello Boys & Girls.
My problem today comes in displaying a hayperlink from my database and returning a hyperlink to my database.
The idea behind this is that when I create a file or folder on my computer that is relevant to my database, I want to be able to add the hyperlink for it to my database.
What I'd like therefore is to know whether or not I use a textbox to display hyperlinks in a vb programs or whether there's a specific box that deals with hyperlinks.
Also, when It comes to adding an hyperlink, I'd like to be able to search for the relevant place on my computer from vb & then return that hyperlink to the database using .edit or .addnew
Thanks
Sam
-
Nov 14th, 2002, 02:56 PM
#2
PowerPoster
Store the path to the file you need in the database. Then you can use a label to display that file. To make it a hyperlink, use the following code:
VB Code:
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL = 1
Private Sub ExecuteFile(FilePath As String)
ShellExecute Me.hwnd, vbNullString, FilePath, vbNullString, "C:\", SW_SHOWNORMAL
End Sub
-
Nov 14th, 2002, 07:42 PM
#3
Thread Starter
Addicted Member
Thanks for that.
I've one small question. I'm already using a recordset to display the information that I want. I'd like to get the label or textbox to recognise that this particular column of the recordset holds hyperlinks & that it should display them. How can I do this using the recordset I have rather than by creating a new connexion?
-
Nov 14th, 2002, 07:53 PM
#4
How about parsing the recordset element that holds the hyperlink. If the first seven characters are http:// then you know it is a hyperlink.
-
Nov 14th, 2002, 07:57 PM
#5
Thread Starter
Addicted Member
I'm not quite sure I understand, Hack. Could you flesh your answer out a little more as I'm fumbling in the dark a bit, being new to this game.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|