构建字段值之外的链接 [英] Building a link out of a field value

查看:52
本文介绍了构建字段值之外的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想探索一些不同的方法来建立一个链接来自数据库中的字符串



财政; swvtc / fiscal / fiscaldata.asp:记录; swvtc / records / recordsdata.asp:

这只是一个包含链接名称的字符串,然后是链接目标。所以我要
需要以编程方式从这个字段构建一个链接。我已经找到了其他一些方法,但它们涉及到
vbscript中的正则表达式,我想知道是否有更有效的方式来做

这个。我的数据库表是这样的,


用户名 - 用户的用户名

用户链接 - 上面的链接,财政; swvtc / fiscal / fiscaldata.asp:

记录; swvtc / records / recordsdata.asp:



这将是用于内联网首页,并允许用户

有快速链接在首页。


谢谢,

Drew Laing

I would like to explore some different ways to build a link out of the
following string from a db,

Fiscal; swvtc/fiscal/fiscaldata.asp: Records; swvtc/records/recordsdata.asp:

Which is just a string that has the link name, then the link target. So I
would need to programmatically build a link from this field. I have found
some other ways around this, but they involve Regular Expressions in
vbscript and I was wondering if there was a more efficient way of doing
this. My database table looks like this,

Username - the username of the user
Userlinks - the links as above, Fiscal; swvtc/fiscal/fiscaldata.asp:
Records; swvtc/records/recordsdata.asp:

I am open to any sort of delimeter instead of the : and ;.

This will be used for an Intranet front page and would allow the users to
have "quick links" on the front page.

Thanks,
Drew Laing

推荐答案

是吧?在那里迷失了我。

你想要 http:// site /从db条目生成的swvtc / fiscal / fiscaldata.asp

或者你想传递一个值?


基本上只是一个简单的响应。写HREF会做你需要的,

只是放入DB查找/读取循环中。


-

Curt Christianson

所有者/首席开发人员,DF-Software

网站: http://www.Darkfalz.com

博客: http://blog.Darkfalz.com

" Drew" < DL **** @ NOswvtc.state.va.SPAMus>在留言中写道

news:u1 ************** @ TK2MSFTNGP10.phx.gbl ...
huh? Lost me there.
You want http://site/swvtc/fiscal/fiscaldata.asp generated from a db entry?
or you want to pass a value?

basically just a simple Response.Write of an HREF will do what you need,
just put in within the DB lookup/read loop.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dl****@NOswvtc.state.va.SPAMus> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
我想探索一些不同的方法来建立一个从数据库中跟随字符串的链接,

财政; swvtc / fiscal / fiscaldata.asp:记录;
swvtc / records / recordsdata.asp:

这只是一个包含链接名称的字符串,然后是链接目标。所以我需要以编程方式从这个领域建立一个链接。我已经找到了其他一些方法,但它们涉及到vbscript中的正则表达式,我想知道是否有更有效的方法来做这个。我的数据库表看起来像这样,

用户名 - 用户的用户名
用户链接 - 上面的链接,财政; swvtc / fiscal / fiscaldata.asp:
记录; swvtc / records / recordsdata.asp:

我对任何类型的分隔符都开放,而不是:和;

这将用于内联网首页,并且会允许用户拥有快速链接。在首页。

谢谢,
Drew Laing
I would like to explore some different ways to build a link out of the
following string from a db,

Fiscal; swvtc/fiscal/fiscaldata.asp: Records;
swvtc/records/recordsdata.asp:

Which is just a string that has the link name, then the link target. So I
would need to programmatically build a link from this field. I have found
some other ways around this, but they involve Regular Expressions in
vbscript and I was wondering if there was a more efficient way of doing
this. My database table looks like this,

Username - the username of the user
Userlinks - the links as above, Fiscal; swvtc/fiscal/fiscaldata.asp:
Records; swvtc/records/recordsdata.asp:

I am open to any sort of delimeter instead of the : and ;.

This will be used for an Intranet front page and would allow the users to
have "quick links" on the front page.

Thanks,
Drew Laing



我建​​议不要输入几种类型的信息一个字段。

添加一个财务字段和一个记录字段..然后你根本不需要解析。


如果你坚持,看看Instr


Jeff

" Drew" < DL **** @ NOswvtc.state.va.SPAMus>在留言中写道

news:u1 ************** @ TK2MSFTNGP10.phx.gbl ...
I would recommend not putting several types of information in one field.
Add a Fiscal field and a Records field..then you don''t need to parse at all.

If you insist however, look at Instr

Jeff
"Drew" <dl****@NOswvtc.state.va.SPAMus> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
我想探索一些不同的方法来建立一个从数据库中跟随字符串的链接,

财政; swvtc / fiscal / fiscaldata.asp:记录;
swvtc / records / recordsdata.asp:
这只是一个包含链接名称的字符串,然后是链接目标。所以我需要以编程方式从这个领域建立一个链接。我已经找到了其他一些方法,但它们涉及到vbscript中的正则表达式,我想知道是否有更有效的方法来做这个。我的数据库表看起来像这样,

用户名 - 用户的用户名
用户链接 - 上面的链接,财政; swvtc / fiscal / fiscaldata.asp:
记录; swvtc / records / recordsdata.asp:

我对任何类型的分隔符都开放,而不是:和;

这将用于内联网首页,并且会允许用户拥有快速链接。在首页。

谢谢,
Drew Laing
I would like to explore some different ways to build a link out of the
following string from a db,

Fiscal; swvtc/fiscal/fiscaldata.asp: Records; swvtc/records/recordsdata.asp:
Which is just a string that has the link name, then the link target. So I
would need to programmatically build a link from this field. I have found
some other ways around this, but they involve Regular Expressions in
vbscript and I was wondering if there was a more efficient way of doing
this. My database table looks like this,

Username - the username of the user
Userlinks - the links as above, Fiscal; swvtc/fiscal/fiscaldata.asp:
Records; swvtc/records/recordsdata.asp:

I am open to any sort of delimeter instead of the : and ;.

This will be used for an Intranet front page and would allow the users to
have "quick links" on the front page.

Thanks,
Drew Laing



这是一个有趣的方法存储你在那里的数据...如果这是你的数据是多少,并假设你无法做任何事情,你可以

做:


Dim sLinks,aLinks,aLink,sLinkTitle,sHref

Dim i


sLinks = yourRecordset.Fields.Item(" Userlinks" ;)。价值

aLinks =拆分(sLinks,":")

for i = 0 To UBound(aLinks)

aLink =分裂(aLinks(i),";")

如果UBound(aLink)= 1那么

sLinkTitle =修剪(aLink(0))

sHref =修剪(aLink(1))

Response.Write"< a href =""" &安培; sHref& """>" &安培; sLinkTitle& "< / a>< br>"

结束如果

下一页

Ray at work

" Drew" < DL **** @ NOswvtc.state.va.SPAMus>在留言中写道

news:u1 ************** @ TK2MSFTNGP10.phx.gbl ...
That is an interesting method of storing data you have there... If this is
how your data is, and assuming you cannot do anything about that, you can
do:

Dim sLinks, aLinks, aLink, sLinkTitle, sHref
Dim i

sLinks = yourRecordset.Fields.Item("Userlinks").Value
aLinks = Split(sLinks, ":")
For i = 0 To UBound(aLinks)
aLink = Split(aLinks(i), ";")
If UBound(aLink) = 1 Then
sLinkTitle = Trim(aLink(0))
sHref = Trim(aLink(1))
Response.Write "<a href=""" & sHref & """>" & sLinkTitle & "</a><br>"
End If
Next
Ray at work

"Drew" <dl****@NOswvtc.state.va.SPAMus> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
我想探索一些不同的方法来建立一个从数据库中跟随字符串的链接,

财政; swvtc / fiscal / fiscaldata.asp:记录;
swvtc / records / recordsdata.asp:

这只是一个包含链接名称的字符串,然后是链接目标。所以我需要以编程方式从这个领域建立一个链接。我已经找到了其他一些方法,但它们涉及到vbscript中的正则表达式,我想知道是否有更有效的方法来做这个。我的数据库表看起来像这样,

用户名 - 用户的用户名
用户链接 - 上面的链接,财政; swvtc / fiscal / fiscaldata.asp:
记录; swvtc / records / recordsdata.asp:

我对任何类型的分隔符都开放,而不是:和;

这将用于内联网首页,并且会允许用户拥有快速链接。在首页。

谢谢,
Drew Laing
I would like to explore some different ways to build a link out of the
following string from a db,

Fiscal; swvtc/fiscal/fiscaldata.asp: Records;
swvtc/records/recordsdata.asp:

Which is just a string that has the link name, then the link target. So I
would need to programmatically build a link from this field. I have found
some other ways around this, but they involve Regular Expressions in
vbscript and I was wondering if there was a more efficient way of doing
this. My database table looks like this,

Username - the username of the user
Userlinks - the links as above, Fiscal; swvtc/fiscal/fiscaldata.asp:
Records; swvtc/records/recordsdata.asp:

I am open to any sort of delimeter instead of the : and ;.

This will be used for an Intranet front page and would allow the users to
have "quick links" on the front page.

Thanks,
Drew Laing



这篇关于构建字段值之外的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆