PDA

View Full Version : Generating links


midgetron
05-10-2006, 07:19 PM
Hi im trying to generate a series of links to mostly pdf files however not quite sure how to do this properly at the moment im using the following code...

response.write "<A HREF="<%=RS("file")%>"> <%=RS("linkname")%> </A>"


Microsoft VBScript compilation error '800a0408'

Invalid character

/irtwebsite/welcome.asp, line 27

response.write "<A HREF="<%=RS("file")
--------------------------^

is the error produced.

I can generate a list of the file names from a file name property field within the database its just the actual linking of the file im having problem with.

thanks for your help

degsy
05-11-2006, 02:48 PM
You are already within ASP code blocks. You don't need to include them again.

midgetron
05-11-2006, 05:14 PM
h i have it generating the links and stuff but now im trying to filter out the files dependant on the user and its not wanting to do that...

Im using the code:

Code:

RS.Open "SELECT * FROM tblFiles WHERE username=User;", objConn

where User is defined as a variable passed from what the user enters on a form...

and its returning the error on the above line...

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

/irtwebsite/welcome.asp, line 25

mehere
05-12-2006, 04:38 AM
if user is a variable ... try this:
"SELECT * FROM tblFiles WHERE username='" & User & "';"
provided User is a text variable ... if it's a number ... remove the single quotes.