Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: How to retrieve URL address in ASP out of database..


Message #1 by "Basia" <bchudak@h...> on Thu, 19 Sep 2002 23:38:43
Hello,
How to retrieve URL address in ASP out of database.
I have created a recordset that holds that value but it will not write to 
the screen. My recordset works since I tested with a different value.
So what I need to find out is code of how to display/format ASP in order 
to show correctly my URL address on screen.

that field is currently holding values as such www.website.com,
how could I use concatenation in order to add http:// str before 
www.website.com.

Thanks in advance for your responses,
Claudia
Message #2 by Mark Eckeard <meckeard2000@y...> on Thu, 19 Sep 2002 17:46:38 -0700 (PDT)
Try this:

strURL = "http://" & RS.Fields("URL").value

response.write (strURL)

Mark
--- Basia <bchudak@h...> wrote:
> Hello,
> How to retrieve URL address in ASP out of database.
> I have created a recordset that holds that value but
> it will not write to 
> the screen. My recordset works since I tested with a
> different value.
> So what I need to find out is code of how to
> display/format ASP in order 
> to show correctly my URL address on screen.
> 
> that field is currently holding values as such
> www.website.com,
> how could I use concatenation in order to add
> http:// str before 
> www.website.com.
> 
> Thanks in advance for your responses,
> Claudia
> 
> ---
> 
> Improve your web design skills with these new books
> from Glasshaus.
> 
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
Message #3 by Vijay G <happygv@y...> on Thu, 19 Sep 2002 20:34:03 -0700 (PDT)
Once you extract the value from DB and have them in the recordset, you can display if using

Response.write or <%=%> followed by <RecordsetObject>.<FIELD_NAME>.value

Just add a <a> tag around it so as to see it as a link.

eg: if the recordset value is www.msn.com then it should be something like.

<a href="<%=Recordset.field.value%>"><%=Recordset.field.value%><a>

It is better you store the exact URL as it is into the Database, so that no work around is needed while displaying it, else you will
have to add "http://" in the href value of <a> tag.

For formating the recordset output, you can refer this link http://www.4guysfromrolla.com/webtech/faq/Databases/faq4.shtml

Cheers!!!
Vijay G

 Basia wrote:Hello,
How to retrieve URL address in ASP out of database.
I have created a recordset that holds that value but it will not write to 
the screen. My recordset works since I tested with a different value.
So what I need to find out is code of how to display/format ASP in order 
to show correctly my URL address on screen.

that field is currently holding values as such www.website.com,
how could I use concatenation in order to add http:// str before 
www.website.com.

Thanks in advance for your responses,
Claudia

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
Message #4 by "Tom Zhang" <tzhang@p...> on Fri, 20 Sep 2002 13:24:14
if you want the url to show up as a link, you may try this:
response.write "<a herf=http://" & rs("url") & ">" & rs("url") & "</a>"

Tom

> Hello,
H> ow to retrieve URL address in ASP out of database.
I>  have created a recordset that holds that value but it will not write 
to 
t> he screen. My recordset works since I tested with a different value.
S> o what I need to find out is code of how to display/format ASP in order 
t> o show correctly my URL address on screen.

> that field is currently holding values as such www.website.com,
h> ow could I use concatenation in order to add http:// str before 
w> ww.website.com.

> Thanks in advance for your responses,
C> laudia

  Return to Index