Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Access Hyperlink Field in Asp.net

Posted on 2007-11-28
5
Medium Priority
?
941 Views
Last Modified: 2012-08-13
I am working with MS Access 2007 and am querying a record set to be bound to a hyperlink web control in Asp.Net.  The format of the Access hyperlink field comes back looking like:

www.mysite.net#http://www.mysite.net#

Is there a good way to just get the format to work with the hyperlink we control? Or do I have to do some fancy parsing?  The part about parsing that worries me is that I think I read somewhere that the MS Access Hyperlink field can contain like 4 parts to it.

Thanks!
0
Comment
Question by:daveokst
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20366288
look for  HyperlinkPart  from the Access Help
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20366301
look for  HyperlinkPart  from the Access VBA Help
0
 

Author Comment

by:daveokst
ID: 20367074
Actually I am not sure how to call HyperLinkPart within Access.  We currently use LLBLGen to generate a data layer to work with generating SQL to pull data from a client's MS Access database.

If there is some SQL syntax that will accomplish the job, please post.  I need to have just the url parsed out so I can set it to the Navigate Url property of the hyperlink control.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 20367173
here is the example from the VBA Help

Example
The following example uses all four of the part argument constants to display information returned by the HyperlinkPart method for each record in a table containing a Hyperlink field. To try this example, paste the DisplayHyperlinkParts procedure into the Declarations section of a module. You can call the DisplayHyperlinkParts procedure from the Debug window, passing to it the name of a table containing hyperlinks and the name of the field containing Hyperlink data. For example:

:DisplayHyperlinkParts "MyHyperlinkTableName", "MyHyperlinkFieldName"

Public Sub DisplayHyperlinkParts(ByVal strTable As String, _
                                 ByVal strField As String)
   
    Dim rst As New ADODB.Recordset
    Dim strMsg As String

       
    rst.Open strTable, CurrentProject.Connection, _
             adOpenForwardOnly, adLockReadOnly

    ' For each record in table.
    Do Until rst.EOF
        strMsg = "DisplayValue = " _
            & HyperlinkPart(rst(strField), acDisplayedValue) _
            & vbCrLf & "DisplayText = " _
            & HyperlinkPart(rst(strField), acDisplayText) _
            & vbCrLf & "Address = " _
            & HyperlinkPart(rst(strField), acAddress) _
            & vbCrLf & "SubAddress = " _
            & HyperlinkPart(rst(strField), acSubAddress) _
            & vbCrLf & "ScreenTip = " _
            & HyperlinkPart(rst(strField), acScreenTip) _
            & vbCrLf & "Full Address = " _
            & HyperlinkPart(rst(strField), acFullAddress)
           
        ' Show parts returned by HyperlinkPart function.
        MsgBox strMsg
        rst.MoveNext
    Loop
   
End Sub
            
When you use the HyperlinkPart method in a query, the part argument is required. For example, the following SQL statement uses the HyperlinkPart method to return information about data stored as a Hyperlink data type in the URL field of the Links table:

SELECT Links.URL, HyperlinkPart([URL],0)
    AS Display, HyperlinkPart([URL],1)
    AS Name, HyperlinkPart([URL],2)
    AS Addr, HyperlinkPart([URL],3)
    AS SubAddr, HyperlinkPart([URL],4)
    AS ScreenTip
    FROM Links

0
 

Author Comment

by:daveokst
ID: 20368403
Thank you for the reference... the VB isn't an option here.  We could implement the sql though.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question