Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Select AND

Status
Not open for further replies.

nadamson

IS-IT--Management
Dec 26, 2004
50
GB
Can anyone answer this problem we have please.

On the local development machine a page is called with 2 URL values (make & model) the page uses these to generate an SQL Select statement from an access database - this all works fine.

Upload the site to the web, and the same page is called with the same values, the page receives the values correctly but the following error occurs.

Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.

The error occurred in D:\Domains\specific-spares.com\ line 8

6 : FROM ProductFindByGroup
7 : WHERE PMIDENT = "#URL.make#"
8 : AND PMODEL = "#URL.model#"
9 : ORDER BY ptype ASC
10 : </cfquery>



--------------------------------------------------------------------------------

SQL SELECT * FROM ProductFindByGroup WHERE PMIDENT = "EVESHAM" AND PMODEL = "VOYAGER C530" ORDER BY ptype ASC
DATASOURCE specificspares
VENDORERRORCODE -3010
SQLSTATE 07002
 
Also, if you remove either of the conditions the other one works fine (except for the fact you select the wrong records - but its a test)
 
OK,

We traced the problem down to the use of double quotes (") instead of single quotes (').

But as this is generated in DW8, and it is dreamweaver that generated the code using double quotes, how do we stop it doing this in future ??????
 
I'm not familiar with dreamweaver, but it should not be using double quotes in queries like that, for sure.

generated by dreamweaver I assume means that the code is created using a query wizard or something.



Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
I use Dreamweaver for simple sites. I have never had this problem. Check your Preference settings in DW. You should not be getting queries built that way.

Cheers,

Bluetone
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top