Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: changing a primary key to a hyperlink....


Message #1 by "grant van zevern" <gvanzeve@u...> on Wed, 28 Feb 2001 07:30:21
I would like to have ASP loop through my database and return the primary 

key number as a link to a page with the corresponding number.  ie. "1" in 

the primary key would write me a link to the page titled "1.html" and so 

forth.  Here's what I've got so far, riddled with syntax errors.



While not objRec.EOF

    Response.Write "<a href="<%primarykey%>.html"</a>"

    ObjRec.MoveNext



This isn't working but I can't figure out another way to write this...

Any suggestions as to what I'm doing wrong or another way to do this? 
Message #2 by "Gerhard Wentink" <wentink@w...> on Wed, 28 Feb 2001 09:29:16 +0100
If the variable "primarykey" really holds the primary key from your database

(I can't find it in your snippet)

Then the syntax should be:

While not objRec.EOF

    Response.Write "<a href=""" & primarykey & ".html"">something goes here

too</a>"

    ObjRec.MoveNext

Loop



Mind the quotes

Regards,

Gerhard Wentink



----- Original Message -----

From: "grant van zevern" <gvanzeve@u...>

To: "ASP Database Setup" <asp_database_setup@p...>

Sent: Wednesday, February 28, 2001 7:30 AM

Subject: [asp_database_setup] changing a primary key to a hyperlink....





> I would like to have ASP loop through my database and return the primary

> key number as a link to a page with the corresponding number.  ie. "1" in

> the primary key would write me a link to the page titled "1.html" and so

> forth.  Here's what I've got so far, riddled with syntax errors.

>

> While not objRec.EOF

>     Response.Write "<a href="<%primarykey%>.html"</a>"

>     ObjRec.MoveNext

>

Message #3 by Mike Williams <mwilliams@w...> on Wed, 28 Feb 2001 08:27:05 -0600
Change as follows:



Response.Write "<a href="<% =primarykey%>.html"</a>"



-----Original Message-----

From: grant van zevern [mailto:gvanzeve@u...]

Sent: Wednesday, February 28, 2001 1:30 AM

To: ASP Database Setup

Subject: [asp_database_setup] changing a primary key to a hyperlink....





I would like to have ASP loop through my database and return the primary 

key number as a link to a page with the corresponding number.  ie. "1" in 

the primary key would write me a link to the page titled "1.html" and so 

forth.  Here's what I've got so far, riddled with syntax errors.



While not objRec.EOF

    Response.Write "<a href="<%primarykey%>.html"</a>"

    ObjRec.MoveNext



This isn't working but I can't figure out another way to write this...

Any suggestions as to what I'm doing wrong or another way to do this? 


  Return to Index