ASP reading from a database

They have: 2 posts

Joined: Jan 2007

hi every1

i am currently having a problem with my asp coding which will not allow me to have individual links on each button i insert from a database. I was wondering if some1 could help me regarding this.

I have set the column type in the database to "hyperlink" and when loading it shows this as text i was wondering if there was a way to make this a link ?

or if u have any other suggestions

Thanks

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Well I don't know what special 'stuff' making the column type 'hyperlink' does, not much I'd imagine. Smiling
It's still just a string really, and to make it a link in your code you need to put it in an 'a' tag.

Could we see what code you've got so far? Then we can make it work. Smiling

a Padded Cell our articles site!

They have: 2 posts

Joined: Jan 2007

this is my coding below

Response.Write "" & objRS("Make/Model") & ""

Response.Write "" & objRS("Description")& ""

strPicture = objRS("Image")
Response.Write "" & "" & ""

Response.write "" & objRS ("Rent") & ""

Response.Write "Price:" & objRS("Price") &""&""

Response.Write "Deposit:" & objRS ("Deposit") & ""
objRS.MoveNext
loop

the column in bold is the one i wud like to make a link, but i have done this using the but it will not let me create a individual link for each column that i read from the database.

THANKS

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

The answer would probably be something like this, the problem is I don't know what you're linking to, or what field needs to be passed to the new page.

Is the rent column set as type 'hyperlink'? I expect 'hyperlink' is just a text field.

What you want will look something like this:

Response.write "<td height=118 ><a href=" & chr(34) & "thepage.asp?id=" & objRS("Id") & chr(34) & ">" & objRS("Rent") & "</a></td></tr>"
'

a Padded Cell our articles site!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.