Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: SQL String..?


Message #1 by "SD-Studios" <info@s...> on Wed, 22 May 2002 22:26:46 +0200
Hi!

I've been trying different ways of getting values, but nothing seems to
work. This is one of the ways I tried.

questionid = CDbl(Request.QueryString("question"))
answerid = CDbl(Request.QueryString("answer"))

SQL = "SELECT * FROM Poll_Answers WHERE question = questionid AND answer 
answerid"

Here's the error I get:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.

What's wrong? =(
--
MVH, Martin Johansson
CEO & Project Supervisor
SD-Studios
+46 (0)70-3003320
http://www.sd-studios.com

Message #2 by "Peter Foti (PeterF)" <PeterF@S...> on Wed, 22 May 2002 17:06:20 -0400
SQL = "SELECT * FROM Poll_Answers WHERE question = questionid AND answer 
answerid"

Should be:

SQL = "SELECT * FROM Poll_Answers WHERE question = " & questionid & " AND
answer = " & answerid


Regards,
Pete

> -----Original Message-----
> From: SD-Studios [mailto:info@s...]
> Sent: Wednesday, May 22, 2002 4:27 PM
> To: ASP Databases
> Subject: [asp_databases] SQL String..?
> 
> 
> Hi!
> 
> I've been trying different ways of getting values, but 
> nothing seems to
> work. This is one of the ways I tried.
> 
> questionid = CDbl(Request.QueryString("question"))
> answerid = CDbl(Request.QueryString("answer"))
> 
> SQL = "SELECT * FROM Poll_Answers WHERE question = questionid 
> AND answer 
> answerid"
> 
> Here's the error I get:
> Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. 
> Expected 2.
> 
> What's wrong? =(
> --
> MVH, Martin Johansson
> CEO & Project Supervisor
> SD-Studios
> +46 (0)70-3003320
> http://www.sd-studios.com
> 
> 
> 

  Return to Index