You probably only need the square brackets around the reserved word. Of
course it would be better not to use it at all.

I notice from the posts on the other thread that you changed the table
column names Nick, and still got an error, albeit slightly different.

In my experience the error you got indicates the fields can't exist in the
db, or that they are numeric - have you tried removing the '' from the query
and or double checking the datatypes in the database:

SELECT *
18 :     FROM Users
19 :     WHERE UserLogin = #Form.UserLogin# AND UserPwd = #Form.UserPwd#

Also, I know it sounds funny, but check the database you are editing is the
correct one for the datasource you are using. I beat my head against a wall
for ages with a similar problem years ago, and it turned out I was looking
at the wrong database. I never made that mistake again.

Cheers

Will

-----Original Message-----
From: Dominic Watson [mailto:[EMAIL PROTECTED] 
Sent: 23 January 2008 21:14
To: CF-Talk
Subject: Re: Too Few Parameters, expected 1

Did you try what I said? Here it is again in case it didn't send.

Try using this query (add square brackets around the database object names
and use CFQUERYPARAM!):

SELECT *
FROM [Users]
WHERE [UserLogin] = <cfqueryparam cfsqltype="cf_sql_varchar"
value="#Form.UserLogin#">
AND [Password] = <cfqueryparam cfsqltype="cf_sql_varchar"
value="#Form.Password#">

If that works then the reason is that one of the database object names
(column names, table names, etc) was the same as an Access function
name/reserved word or some-such.

Let me know how it goes.

Dominic

p.s. please don't use caps all the time, you may be in a foul mood (we've
all been there) - but don't take it out on us!

On 23/01/2008, Nick Ross <[EMAIL PROTECTED]> wrote:
>
> ENTERED AN EARLIER POST ON THIS SAME QUERY PROBLEM. ORIGINALLY IT WAS 
> A SYNTAX PROBLEM. HOWEVER, NOW I AM GETTING THE FOLLOWING ERROR. THIS 
> IS A SIMPLE LOGIN APPLICATION.
>
> Error Executing Database Query.
> [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC 
> Microsoft Access Driver] Too few parameters. Expected 1.
>
> The error occurred in
> C:\Inetpub\wwwroot\RickRossiter\NLR\Templates\loginCheck.cfm: line 19 
> Called from C:\Inetpub\wwwroot\RickRossiter\NLR\Templates\loginForm.cfm:
> line 206
> Called from
> C:\Inetpub\wwwroot\RickRossiter\NLR\PrivateAccess\Application.cfm: 
> line 17 Called from
C:\Inetpub\wwwroot\RickRossiter\NLR\Templates\loginCheck.cfm:
> line 19
> Called from C:\Inetpub\wwwroot\RickRossiter\NLR\Templates\loginForm.cfm:
> line 206
> Called from
> C:\Inetpub\wwwroot\RickRossiter\NLR\PrivateAccess\Application.cfm: 
> line 17
>
> 17 :    SELECT *
> 18 :     FROM Users
> 19 :     WHERE UserLogin = '#Form.UserLogin#' AND Password =
> '#Form.Password#'
> 20 : </cfquery>
> 21 :
>
> SQL        SELECT * FROM Users WHERE UserLogin = 'paulw' AND Password =
> 'PPMILL'
> DATASOURCE        RickRossiter
> VENDORERRORCODE           -3010
> SQLSTATE          07002
> Resources:
>
>    * Check the ColdFusion documentation to verify that you are using 
> the correct syntax.
>    * Search the Knowledge Base to find a solution to your problem.
>
> Browser         Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
> 1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
>
>
> CODE SOURCE:
>
> PROCESS BEGINS IN (application.cfm) WHEN USER ENTERS SECTION OF SITE 
> REQUIRING A LOGIN:
>
> (application.cfm)
>
> <!---If user is not logged in force them to log in--->
>
> <cfif NOT isDefined("SESSION.Auth.IsLoggedIn")>
>
>        <!---If the user is now submitting login action via login form--->
>    <!---Include "Login Check" code to validate the user attempting to 
> log in.--->
>
>    <cfinclude template="../Templates/loginForm.cfm">
>    <cfabort>
> </cfif>
>
> NEXT THE USER IS PROMPTED TO THE LOGIN PAGE:
>
> <cfif isDefined("form.UserLogin")>
>        <cfinclude template="loginCheck.cfm"> </cfif>
>
>
> <span class="Header">Enter Access Code</span>
> <br>
> <cfform action="../PrivateAccess/showAR.cfm" Name="LoginForm"
> method="post">
> <input type="hidden" name="UserLogin_required">
> <input type="hidden" name="Password_required">
>    <!---userLogin Field is required--->
>    User Name:
>        <cfinput
>        type="text"
>        name="UserLogin"
>        size="20"
>        value=""
>        maxlength="24"
>        required="yes"
>        message="Please enter your user name. Thank you."
>        style="height:14px; width:125px; font-size:12px; font-weight:bold;
> color: maroon; letter-spacing:0.2em; text-align:left;">
>        <p>&nbsp;</p><p>&nbsp;</p>
>    Password:
>    <cfinput
>        type="password"
>        name="Password"
>        size="24" value=""
>        maxlength="24"
>        required="yes"
>        message="Please enter your assigned password to access this part of
> the site. Thank you."
>        style="height:14px; width:125px; font-size:12px; font-weight:bold;
> color: maroon; letter-spacing:0.2em; text-align:left">
>
> <cfinput type="submit" name="Enter">
>
> </cfform>
>
> WHICH IS CHECKED BY THE FOLLOWING CODE:
>
> <!---The following code queries the database to find the record of the
> user's password.--->
> <cfparam name="Form.UserLogin" type="string">
> <cfparam name="Form.Password" type="string">
>
>
> <cfquery name="getUser" datasource="#dsn#">
>        SELECT *
>    FROM Users
>    WHERE UserLogin = '#Form.UserLogin#' AND Password = '#Form.Password#'
> </cfquery>
>
>
>
> <!---
>        If the user's password is correct the following code verifies
>        it and obtains the information then creates a distinct session for
> each user
>        that logs in.
> --->
>
> <cfif getUser.RecordCount EQ 1>
>    <cflocation url="../PrivateAccess/showAR.cfm">
>
>        <!---
>                The following code remembers the user's "logged-in" status
>                their user type and their first name in the session
> structure.
>        --->
>    <cfset SESSION.Auth = StructNew()>
>    <cfset SESSION.Auth.IsLoggedIn = "yes">
>    <cfset SESSION.Auth.userID = getUser.userID>
>    <cfset SESSION.Auth.FirstName = getUser.FirstName>
>
>    <!---
>                Now that user is logged in, the following code sends them
> to
>                PrivateAccess/showAR.cfm page and menu links.
>        --->
>    <cflocation url="#CGI.SCRIPT_NAME#">
> </cfif>
>
> AS YOU CAN SEE THE QUERY "IS" PULLING THE DATA FROM THE DATABASE, BUT
> THROWING THIS ERROR MESSAGE. I TURNED ON DEBUGGING BUT THIS DID NOT REVEAL
> ANYTHING MORE THAN THE ORIGINAL ERROR MESSAGE. USING DREAMWEAVER 8 AND
CFMX
> SERVERS. IF ANYONE CAN EXPLAIN THIS I SURE WOULD APPRECIATE IT.
>
> NICK
> [EMAIL PROTECTED]
>
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297234
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to