Results 1 to 6 of 6

Thread: [2008] VB .NET + Access 2003 + LinkLabel

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Location
    Texas
    Posts
    3

    [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.

  2. #2
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    Re: [2008] VB .NET + Access 2003 + LinkLabel

    vb.net Code:
    1. Private Sub Form2_Load( _
    2.     ByVal sender As System.Object, _
    3.     ByVal e As System.EventArgs _
    4. ) Handles MyBase.Load
    5.  
    6.     LinkLabel1.Text = "Open Google"
    7.     LinkLabel1.Links(0).LinkData = "www.google.com"
    8. End Sub
    9.  
    10. Private Sub LinkLabel1_LinkClicked( _
    11.     ByVal sender As System.Object, _
    12.     ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs _
    13. ) Handles LinkLabel1.LinkClicked
    14.  
    15.     System.Diagnostics.Process.Start(LinkLabel1.Links(0).LinkData.ToString)
    16. End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Location
    Texas
    Posts
    3

    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.

  4. #4
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    Re: [2008] VB .NET + Access 2003 + LinkLabel

    Quote 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

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Location
    Texas
    Posts
    3

    Thumbs up 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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Location
    Texas
    Posts
    3

    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
  •  



Click Here to Expand Forum to Full Width