473,664 Members | 2,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Building a link out of a field value

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 programmaticall y 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
Jul 21 '05 #1
11 1724
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.SPAMu s> wrote in message
news:u1******** ******@TK2MSFTN GP10.phx.gbl...
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 programmaticall y 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

Jul 21 '05 #2
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.SPAMu s> wrote in message
news:u1******** ******@TK2MSFTN GP10.phx.gbl...
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 programmaticall y 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

Jul 21 '05 #3
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.F ields.Item("Use rlinks").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.SPAMu s> wrote in message
news:u1******** ******@TK2MSFTN GP10.phx.gbl...
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 programmaticall y 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

Jul 21 '05 #4
Well, I want to lump it all in one field, like this,

Fiscal; swvtc/fiscal/fiscaldata.asp: Records; swvtc/records/recordsdata.asp :
Blah; swvtc/blah/blah.asp: Double Blah; swvtc/blahblah/blah.asp

So that I don't have to have seperate fields for all of this... This is an
intranet, so swvtc/records/recordsdata.asp is the actual link. I just need
to make links like so,

<a href="swvtc/records/recordsdata.asp ">Records</a>

In otherwords, the name of the link is the first entry followed by a ; and
then the actual link is after that.

Hope I've made myself more clear!

Thanks,
Drew


"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:%2******** ********@TK2MSF TNGP14.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.SPAMu s> wrote in message
news:u1******** ******@TK2MSFTN GP10.phx.gbl...
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 programmaticall y 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


Jul 21 '05 #5
Split() will get it into an array, then jsut loop the array for the items

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Drew" <dl****@NOswvtc .state.va.SPAMu s> wrote in message
news:OX******** ******@TK2MSFTN GP09.phx.gbl...
Well, I want to lump it all in one field, like this,

Fiscal; swvtc/fiscal/fiscaldata.asp: Records;
swvtc/records/recordsdata.asp : Blah; swvtc/blah/blah.asp: Double Blah;
swvtc/blahblah/blah.asp

So that I don't have to have seperate fields for all of this... This is an
intranet, so swvtc/records/recordsdata.asp is the actual link. I just
need to make links like so,

<a href="swvtc/records/recordsdata.asp ">Records</a>

In otherwords, the name of the link is the first entry followed by a ; and
then the actual link is after that.

Hope I've made myself more clear!

Thanks,
Drew


"Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
news:%2******** ********@TK2MSF TNGP14.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.SPAMu s> wrote in message
news:u1******** ******@TK2MSFTN GP10.phx.gbl...
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 programmaticall y 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



Jul 21 '05 #6
Well that isn't how the data has to be, I just wanted users to be able to
have as many links as they wanted, and I didn't know of a structure that
could do that.

I guess I could use something like this,

Username
UserLink1
UserLink2
UserLink3
UserLink4
UserLink5
UserLink6
UserLink7
UserLink8
UserLink9
UserLink10

Would that be a better structure?

Thanks,
Drew

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:Ov******** ******@TK2MSFTN GP10.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.F ields.Item("Use rlinks").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.SPAMu s> wrote in message
news:u1******** ******@TK2MSFTN GP10.phx.gbl...
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 programmaticall y 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


Jul 21 '05 #7
NO, this would be a terrible design! You waste 10 columns on the user who
doesn't want any links, 9 columns on the user who only wants one, and you
don't have enough for the user who wants 11 (or 111).

CREATE TABLE dbo.Users
(
UserID INT IDENTITY(1,1) PRIMARY KEY,
Username VARCHAR(32) NOT NULL UNIQUE
)

CREATE TABLE dbo.UserLinks
(
UserID INT NOT NULL
FOREIGN KEY REFERENCES dbo.Users(UserI D),
Link VARCHAR(32)
)

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Drew" <dl****@NOswvtc .state.va.SPAMu s> wrote in message
news:OP******** ******@TK2MSFTN GP14.phx.gbl...
Well that isn't how the data has to be, I just wanted users to be able to
have as many links as they wanted, and I didn't know of a structure that
could do that.

I guess I could use something like this,

Username
UserLink1
UserLink2
UserLink3
UserLink4
UserLink5
UserLink6
UserLink7
UserLink8
UserLink9
UserLink10

Would that be a better structure?

Thanks,
Drew

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:Ov******** ******@TK2MSFTN GP10.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.F ields.Item("Use rlinks").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.SPAMu s> wrote in message
news:u1******** ******@TK2MSFTN GP10.phx.gbl...
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 programmaticall y 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



Jul 21 '05 #8
That's what I thought, but I hadn't thought about your design...

How can I make an insert page that has checkboxes that the users check which
links they want and then it inserts a new record for each item checked? I
don't think that I have ever done this.

Thanks!
Drew

"Aaron [SQL Server MVP]" <te*****@dnartr eb.noraa> wrote in message
news:u9******** ******@TK2MSFTN GP09.phx.gbl...
NO, this would be a terrible design! You waste 10 columns on the user who
doesn't want any links, 9 columns on the user who only wants one, and you
don't have enough for the user who wants 11 (or 111).

CREATE TABLE dbo.Users
(
UserID INT IDENTITY(1,1) PRIMARY KEY,
Username VARCHAR(32) NOT NULL UNIQUE
)

CREATE TABLE dbo.UserLinks
(
UserID INT NOT NULL
FOREIGN KEY REFERENCES dbo.Users(UserI D),
Link VARCHAR(32)
)

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Drew" <dl****@NOswvtc .state.va.SPAMu s> wrote in message
news:OP******** ******@TK2MSFTN GP14.phx.gbl...
Well that isn't how the data has to be, I just wanted users to be able to
have as many links as they wanted, and I didn't know of a structure that
could do that.

I guess I could use something like this,

Username
UserLink1
UserLink2
UserLink3
UserLink4
UserLink5
UserLink6
UserLink7
UserLink8
UserLink9
UserLink10

Would that be a better structure?

Thanks,
Drew

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:Ov******** ******@TK2MSFTN GP10.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.F ields.Item("Use rlinks").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.SPAMu s> wrote in message
> news:u1******** ******@TK2MSFTN GP10.phx.gbl...
>>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 programmaticall y 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
>>
>
>



Jul 21 '05 #9
You create an HTML form <form> and have the form submit data to an ASP page
that processes the data and updates your database. That's the generic
explanation anyway.

I suggest starting a new thread if you would like to discuss this further,
as the topic has now changed.

Ray at work

"Drew" <dr********@NOs wvtc.dmhmrsas.v irginia.SPMgov> wrote in message
news:u0******** ******@TK2MSFTN GP14.phx.gbl...

How can I make an insert page that has checkboxes that the users check
which links they want and then it inserts a new record for each item
checked? I don't think that I have ever done this.


Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2151
by: Acorn Tutors | last post by:
Hi folks, what I would like to do is to store the name of a link, such as link1.php in a field, lets say the field is called Favoritelinks, in a database as a bit of text. Then, on a logged in page, pull the value from the field and put in right in the <a href><a> tag so that the link now points to a file, and is dynamic. And, depending on the username and password, the value taken from Favoritelinks changes. What Im after is to...
2
7594
by: Bennett Haselton | last post by:
I'm looking for a PHP tutorial that specializes in how to build sites that are based around user logins. i.e. the user logs in on the front page, and are taken to a main login page where fields on the page are populated with values from some server-side database. Ideally, there would be a server-side "user" database table, with fields such as "age", so that you could insert a short tag in the PHP source like: Your age is: <?php ?> ...
4
2177
by: Dodo | last post by:
Is it possible to create a link that can post a value to an ASP page without java?
4
6004
by: Melissa | last post by:
I have a frontend file named CustomerApp and backend file named CustomerData. CustomerApp is at C:\Customer Database and CustomerData is at S:\Customer Database. Could someone help me with the code to do the following: 1. Create a new table named TblCustomerContact in CustomerData 2. Add a field named CustomerContactID (autonumber) in TblCustomerContact 3. Add a field named CustomerID (Number-Long) in TblCustomerContact 4. Add a field...
13
3980
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate button "Unexpected Error":3251 operation is not supported for this type of object.The demo cd has two databases, one is called inventory and the other just has the tables for the design called inventory data. When you run inventory the database works...
5
6844
by: james.calhoun | last post by:
I feel like this should be really easy... I want a hidden field in a form to have its value defined when someone clicks on a link. So if they click on link "A" the value of the hidden field becomes "A", while if they click "B" the value of hidden field becomes "B" Help?
2
16178
by: Troll | last post by:
Windows XP Pro VS 2005 & C# (I'm fairly new to C# but have doing VB.Net going on 2yrs and VB6 for 5yrs.) I'm using C# to build a custom RSS generator. I'm having trouble building the guid element for each item node in my feed. Some items do not have the "link" node because the description element is the content. So using the "link" as the guid will not work in my case, as some sites suggest and as feedvalidator.org complains when I do not...
3
3490
by: Sandman | last post by:
So, I've used ajax for quite some time for different stuff. Mostly I just feed a funktion I made with the ID of the DIV that should be updated with the output from page XXX.php Now I want to have a standard funktion to set a JS variabel to the output of a page. I am doing a date validation thing, which is done in PHP. So this is how far I've come so far: function ajaxresults(url){ var ajax = createAjaxObject();
17
4432
by: john | last post by:
All: I'm a long-time developer, new to PHP.... Is there an idiom used in PHP to construct SQL statments from $_POST data? I would guess that in many applications, the data read from $_POST are used to build SQL statements. Certainly, we can do the following:
0
8437
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8861
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2764
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1759
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.