Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Changing ColdFusion script for SQL queries to queries for ACCESS

Posted on 2007-11-21
2
Medium Priority
?
151 Views
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#'
</cfquery>

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.

Thanks
0
Comment
Question by:Ryan Bayne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
_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">
		SELECT  *
		FROM	Users
		WHERE   UserName       = '#Form.UserName#'
		AND     Password       = '#Form.Password#'
	</cfquery>
	<cfif checkUser.recordCount GT 0>
		<div style="color: #008000;">
			Success.  Username and password validated!
		</div>
	<cfelse>	
		<div style="color: #ff0000;">
			Error. Invalid username or password entered
		</div>
	</cfif>
</cfif>
 
<!--- 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">
</form>

Open in new window

0
 
LVL 2

Author Comment

by:Ryan Bayne
ID: 20333114
Excellent!
0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

636 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