error reasing database file

error reasing database file

am 01.01.2007 19:23:44 von DFS

can somebody tell me what's wrong wth this code ?

IF Request.QueryString("YEAR") <> "" THEN
SELECT * FROM tblMatches ORDER BY Year DESC,
END IF

I'm getting an error message: "Server error: Unable to retrieve schema
information from the query:"

I'm working on a Web site that reads a simple database file created in
Access.

The Web site has an asp page called results.asp and I used Frontpage to
design it. Part of the asp page is a table (comes standard with Frontpage)
and this table gets filled with the data from the database file based on a
custom query

There are 3 scenarios:

1. I need to display all the data from the database file and the URL and
custome query look like this:

http://localhost/data/result.asp

SELECT * FROM tblData ORDER BY Year DESC,

2. I need to display all the data that match certain year

http://localhost/data/result.asp?Year=2006

SELECT * FROM tblData WHERE (Year = ::Year::)
ORDER BY Year DESC


3. I need to display all the data that match certain name

http://localhost/data/result.asp?Name=Smith

SELECT * FROM tblData WHERE (Name = ::Name::)
ORDER BY Year DESC

My question is how do I combine all 3 above SQL statements into one.

TIA

Re: error reasing database file

am 01.01.2007 19:42:10 von exjxw.hannivoort

John wrote on 01 jan 2007 in microsoft.public.inetserver.asp.general:

> can somebody tell me what's wrong wth this code ?
>
> IF Request.QueryString("YEAR") <> "" THEN
> SELECT * FROM tblMatches ORDER BY Year DESC,
> END IF

IF Request.QueryString("YEAR") <> "" THEN
sql =" SELECT * FROM tblMatches ORDER BY Year DESC"
END IF

You cannot mix sql ans vbscript at [pseudo]random

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: error reasing database file

am 01.01.2007 19:42:44 von Jon Paal

looks like you are unfamiliar with using ASP.
I recommend following some examples from this tutorial site.

http://msconline.maconstate.edu/tutorials/default.aspx