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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DEFAULT PARAMETER VALUE??? 1

Status
Not open for further replies.

hpvic03

Technical User
Aug 2, 2006
89
I'm trying to set up a web page so that people can fill out a form then it shows them a specific record in the databse, so I used this code:

<cfquery name="home" datasource="myDS">
SELECT fname, lname, email, password
FROM studentID
WHERE home.email = <cfqueryparam value="#form.email#">
AND home.password = <cfqueryparam value="#form.password#">
</cfquery>

to test it, I filled in one record in the database with information, then filled out the form to match. when i tried to test it, i get this error message:

Parameter home.password has no default value.

I am using Microsoft Access, and i am positive that I filled in the record and the form correctly. What is wrong? Help please!!!
 
Why are you using the queryname inside itself?

Code:
<cfquery name="[b]home[/b]" datasource="myDS">
SELECT  fname, lname, email, password
FROM    studentID
WHERE   [b]home.[/b]email = <cfqueryparam value="#form.email#">
AND [b]home.[/b]password = <cfqueryparam value="#form.password#">
</cfquery>

Replace what you have with:
Code:
<cfquery name="home" datasource="myDS">
SELECT  fname, lname, email, password
FROM    studentID
WHERE   email = <cfqueryparam value="#form.email#">
AND password = <cfqueryparam value="#form.password#">
</cfquery>

Notice the bold portion is missing in my version.

BTW, if you're going to the <cfqueryparam...> tag then you should really use the CFSQLType attribute.
____________________________________
Just Imagine.
 
Wow thank you so much, i've been fiddling with this for hours. and I would use those cfsql attributes... if i could just find out what they mean. i'm looking right now and im sure i'll find a page soon. thanks so much, i'll probably be posting again soon as I'm pretty new at this.
 
hpvic03, np. One great thing about Tek-Tips is that there are ppl with all sorts of skill sets and experiences.

The link I gave in my last post shows what the CFSELTYPE means, and when to use them.

____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top