Guest_imported
New member
- Jan 1, 1970
- 0
I need to create a CF application that prompts for
ID and password on my Access 2000 database that would
display a welcome message or returen me back to the
login page if password is invalid.
My attempt below doesnt work. It does pull up the ID and passwrd if I put in the correct ones but if I put in incorrect Id or password I get CF error messages. I need it to return back to me a message saying invalid login if user id or password is incorrect.
[tt]
<cfquery name="queryDoc" datasource="hom3" dbtype="ODBC">
<CFIF #FORM.passwrd# EQ "" and #FORM.cust_id# EQ "">
select *
from
customer
<CFELSEIF #FORM.passwrd# GT "" and #FORM.cust_id# EQ "">
select *
from customer
where passwrd = #FORM.passwrd#
<CFELSEIF #FORM.passwrd# EQ "" and #FORM.cust_id# GT "">
select *
from customer
where cust_id = #FORM.cust_id#
<CFELSE>
select *
from
customer where passwrd = #form.passwrd#
and cust_id = #form.cust_id#
</CFIF>
</cfquery>
<cfif #queryDoc.RecordCount# EQ 0>
<H1 ALIGN="center">No Record Found</H1>
<CFELSE>
<cfoutput query="queryDoc">[/tt]
ID and password on my Access 2000 database that would
display a welcome message or returen me back to the
login page if password is invalid.
My attempt below doesnt work. It does pull up the ID and passwrd if I put in the correct ones but if I put in incorrect Id or password I get CF error messages. I need it to return back to me a message saying invalid login if user id or password is incorrect.
[tt]
<cfquery name="queryDoc" datasource="hom3" dbtype="ODBC">
<CFIF #FORM.passwrd# EQ "" and #FORM.cust_id# EQ "">
select *
from
customer
<CFELSEIF #FORM.passwrd# GT "" and #FORM.cust_id# EQ "">
select *
from customer
where passwrd = #FORM.passwrd#
<CFELSEIF #FORM.passwrd# EQ "" and #FORM.cust_id# GT "">
select *
from customer
where cust_id = #FORM.cust_id#
<CFELSE>
select *
from
customer where passwrd = #form.passwrd#
and cust_id = #form.cust_id#
</CFIF>
</cfquery>
<cfif #queryDoc.RecordCount# EQ 0>
<H1 ALIGN="center">No Record Found</H1>
<CFELSE>
<cfoutput query="queryDoc">[/tt]