|
-
Feb 15th, 2009, 08:06 PM
#1
Thread Starter
New Member
[2008] VB .NET + Access 2003 + LinkLabel
I have a small and simple program. I am accessing an Access 2003 database that has seven columns:
ID-AutoNumber (3) - Primary Key
Business-Text (40)
Address-Text (40)
City-Text (20)
Phone-Text (14)
URL-Text (255)
Map-Text (255)
In VB, under Data Sources, I set five to textbox and the last two to linklabel. I then dragged each to my form. When I run the program, everything works, navigation and data displayed. However, I have not been able to figure out how to have the URL and Map (linklabels) when clicked to open into a browser. I have found many sites on the web that gives me example code to hard code one specific linklabel to be presented as a hyperlink, but have not found a solution to making a linklabel a hyperlink when the data is filled from an Access database. I am also trying to figure out how to mask the data. For example, I want URL http://www.google.com to display as Homepage, and http://maps.google.com to display as Directions. I have limited experience in progamming, and have read most of what I have learned. I have forgotten most of the programming I learned in several college courses from many years ago. Thanks in advance for any help or direction anyone may have for me.
-
Feb 16th, 2009, 06:17 AM
#2
Re: [2008] VB .NET + Access 2003 + LinkLabel
vb.net Code:
Private Sub Form2_Load( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs _ ) Handles MyBase.Load LinkLabel1.Text = "Open Google" LinkLabel1.Links(0).LinkData = "www.google.com" End Sub Private Sub LinkLabel1_LinkClicked( _ ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs _ ) Handles LinkLabel1.LinkClicked System.Diagnostics.Process.Start(LinkLabel1.Links(0).LinkData.ToString) End Sub
-
Feb 16th, 2009, 10:17 PM
#3
Thread Starter
New Member
Re: [2008] VB .NET + Access 2003 + LinkLabel
Thank you Deepak for your assistance. Correct me if I am wrong, but doesn't your code specifically state to go to a hyperlink? My LinkLabels are filled from a Text column in an Access database. So the hyperlink changes as one navigates through the data via the navigation bar. I am trying to read through and understand some info I've found about AddHandler, but I am not sure if this would be the answer. Below is a screeshot of the form:

Please let me know if more information would be helpful. Thanks again for your help.
-
Feb 17th, 2009, 02:28 AM
#4
Re: [2008] VB .NET + Access 2003 + LinkLabel
 Originally Posted by markallensimmons
Thank you Deepak for your assistance. Correct me if I am wrong, but doesn't your code specifically state to go to a hyperlink?
That was just an example which tells you how LinkLabel control works. When you navigating through the records then just set the Text and LinkData properties of LinkLabel control to appropriate values from database.
By the way, the design of your is quite impressive
-
Feb 19th, 2009, 11:25 PM
#5
Thread Starter
New Member
Re: [2008] VB .NET + Access 2003 + LinkLabel
Thanks Deepak for the compliment. I finally got it to work. Now I have a new problem. I was hoping that since the aqpplication is small and simple, that it would easily be portable. I have a method that has worked flawlessly using Winrar and UniExtract to make any application portable. However, it does not work with this one. The dilema is that if you do not already have .Net Framework 3.5 SP1 installed, it connects to the Internet to download. Is there another alternative or is their a solution that I can simply put the .NET intall file on the thumb drive, and code the program to install from the application folder? I found in the Project properties where I could change those features, but after playing around with it I have not found a solution. Thanks again for your assistance.
-
Mar 1st, 2009, 03:21 AM
#6
Thread Starter
New Member
Re: [2008] VB .NET + Access 2003 + LinkLabel
Again, thanks Deepak for your assistance. After researching my problem it is nearly impossible to create a portable .Net app because of the dependencies in the OS. If the computer does not have .Net Framework 3.5 installed is requires a download and install. I have sinced rewritten the app in VB6. It works well, and is now portable since it does not need to install only run an exe file. Thanks for all your help.
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
|