Changing ColdFusion script for SQL queries to queries for ACCESS

Posted on 2007-11-21
Medium Priority
Last Modified: 2013-12-16
Here is an example...

<cfquery name="GetUser" datasource="truckpoetry">
SELECT      *
FROM       Users
WHERE      UserName       = '#Form.UserName#'
AND       Password       = '#Form.Password#'

I badly need a simple ColdFusion page that allows user to login using information (Username and password) provided during registration with a basic correct or wrong reply. All tutorials seem to be for SQL.

Can someone help me understand how to make them suit an ACCESS database.

Question by:Ryan Bayne
LVL 53

Accepted Solution

_agx_ earned 1000 total points
ID: 20332369
That query works perfectly against an Access database.   Note, the attached is _not_  a good way to do a login.  It's an example meant to demonstrate the query does work 'as is' with Access.

<cfif IsDefined("form.submitButton")>
	<cfquery name="checkUser" datasource="truckpoetry">
		FROM	Users
		WHERE   UserName       = '#Form.UserName#'
		AND     Password       = '#Form.Password#'
	<cfif checkUser.recordCount GT 0>
		<div style="color: #008000;">
			Success.  Username and password validated!
		<div style="color: #ff0000;">
			Error. Invalid username or password entered
<!--- change thisPage.cfm to name of your test page ---> 
<form action="thisPage.cfm" method="post">
	UserName <input type="text" name="userName"><br>
	Password <input type="password" name="password"><br>
	<input type="submit" name="submitButton">

Open in new window


Author Comment

by:Ryan Bayne
ID: 20333114

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question