开发者

SQL to populate a hyperlink column in MS Access

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 t开发者_如何学Pythonhe SQL Script for achieving this. Thanks.


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.


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜