SQL to populate a hyperlink column in MS Access

前端 未结 2 623
离开以前
离开以前 2021-01-22 03:26

I imagine the SQL must pass 2 values, the value shown in the table and the link to which that value navigates.

I\'d appreciate a pointer to the SQL Script for achieving

相关标签:
2条回答
  • 2021-01-22 04:00

    The format for a hyperlink column (field) is:

    Description#Address#

    For example:

    This is StackOverflow#http://stackoverflow.com#
    Mr E Xample#mailto:example@example.com#
    

    For the most part, I prefer to avoid hyperlink fields (columns) as editing them is a real problem. A text or memo field with a little code is much simpler, though you will need a form.

    0 讨论(0)
  • 2021-01-22 04:00

    If you're looking for a query to extract the Description and Address from a hyperlink field, try this:

    SELECT
        hlink,
        Left(hlink,InStr(1,hlink,"#")-1) AS link_description,
        Mid(hlink,InStr(1,hlink,"#")+1,InStr(InStr(1,hlink,"#")+1,hlink,"#")-InStr(1,hlink,"#")-1) AS link_address
    FROM tblHyperlink;
    

    It's sure not pretty. And it will return #Error for hyperlink fields which are Null or contain less than two # characters.

    0 讨论(0)
提交回复
热议问题