Forum Moderators: open

Message Too Old, No Replies

Error in SQL

error 80040e10

         

Andrew Thomas

2:55 pm on Oct 7, 2003 (gmt 0)

10+ Year Member



Can anyone see any error on this line?

rs_case.Source = "Select distinct pc_case_model FROM pc_cases WHERE pc_base_model = '" & Request.Form("pc_base_model") & "'"

the error message is :

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

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

thanks

WebJoe

3:08 pm on Oct 7, 2003 (gmt 0)

10+ Year Member



Have you tried a
Response.Write "Select distinct pc_case_model FROM pc_cases WHERE pc_base_model = '" & Request.Form("pc_base_model") & "'"

to see if it returns the forms value properly?

I suspect that your error lies there.

Andrew Thomas

3:19 pm on Oct 7, 2003 (gmt 0)

10+ Year Member



yes, it returned the form value back.

Im a bit confused, where is my problem then?

thanks for your help

wackal

4:22 pm on Oct 7, 2003 (gmt 0)

10+ Year Member



what is the value for Request.Form("pc_base_model")?

Usually that error shows up when there is a data type mismatch. The field value for pc_base_model seems to be text from the SQL query you posted.

Andrew Thomas

4:32 pm on Oct 7, 2003 (gmt 0)

10+ Year Member



it shows

'Celeron 1.8Ghz/400 MHz FSB, 0Mb RAM (2Gb Max), FDD, 10/100 LAN, 6xUSB'

which is correct.

But when i use the SELECT statement i get the error.

help

defanjos

4:36 pm on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try:
" & Request.Form("pc_base_model") & "

instead of:
'" & Request.Form("pc_base_model") & "'

Andrew Thomas

8:24 am on Oct 8, 2003 (gmt 0)

10+ Year Member



Ive tried your suggestions, but it still doesnt work.

Zaphod Beeblebrox

10:18 am on Oct 8, 2003 (gmt 0)

10+ Year Member



There's a typo in your WHERE-clause: pc_case_model and pc_base_model

Andrew Thomas

11:26 am on Oct 8, 2003 (gmt 0)

10+ Year Member



thanks for all your help, there was an error uploading my database, i reloaded it and it worked?

Since then ive changed the code around and its coming along well, but will probably need help later :)

but thanks for the help

Andrew