Ask a Question related to Coldfusion Database Access, Design and Development.
-
Jabez Clegg #1
Getting Data From a Database
Hi There!!
I am trying to get data from an access database to be displayed in my
coldfusion website.
Scenario
I am creating a website for purchasers of used vehicles, where they can enter
a vehicle registration number and having clicked on the proceed button, data is
extracted from my database and displayed on screen. it is a similar project to
the AA Car Data checker.
([url]http://www.theaa.com/whitelabel/cardatacheck/index.jsp?clientid=10019[/url]).
Can anybody PLEASE help me find a way in which when a vehicle registration is
enterd the website checks the database and returns the data matching the
registration, e.g. Make, Model, Colour etc. i have tried the binding in
dreamweaver/ColdFusion and it hasnt worked. i have also looked in books but
with no success.
Below is a listing of the code i have so far.
Thank You for your help in advance.
<cfquery name="Vehicle" datasource="project">
SELECT Car_Registration
FROM Vehicle
</cfquery>
<cfquery name="Make" datasource="project">
SELECT Make
FROM Vehicle
</cfquery>
<cfquery name="Model" datasource="project">
SELECT Model
FROM Vehicle
</cfquery>
<cfquery name="Colour" datasource="project">
SELECT Colour
FROM Vehicle
</cfquery>
<cfquery name="Engine" datasource="project">
SELECT Engine
FROM Vehicle
</cfquery>
<cfquery name="button" datasource="project">
SELECT *
FROM Vehicle, Status
</cfquery>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Project Website</title>
<link rel="stylesheet" href="3col_leftNav.css" type="text/css">
<style type="text/css">
<!--
.style1 {font-size: x-large}
-->
</style>
</head>
<body>
<div id="masthead">
<h1 align="center" class="style1" id="siteName">Car Data Checker - MMU
Project<img src="fd2767e6.jpg" width="155" height="118" align="right"></h1>
<p align="right"> </p>
<div id="globalNav">
<p><a href="#">Home</a> | <a href="Data%20Checker.htm">Car Data Check
</a>| <a href="Review.htm">Vehicle Reviews</a>| |<a href="Safety And
Maintainence.htm"> Saftey & Maintaintence</a>| About Us| Site Map </p>
</div>
</div>
<div id="navBar">
<div id="sectionLinks">
<h3 align="center">Importing / Exporting Vehicles </h3>
<ul>
<li>
<div align="center"><a href="Importing a Vehicle.htm">Importing a
Vehicle </a>
<ul>
<li><a href="Commercial%20Imports.htm">Commercial Importers of
New Vehicles</a></li>
<li>
<a href="Permanent%20&%20Temporary%20Imports.htm">Per manent /
Tempory Export</a></li>
</ul>
</div>
</li>
</ul>
</div>
<div class="relatedLinks">
<h3>Consumer Advice </h3>
<ul>
<li><a href="#">Buying a Vehicle </a></li>
<li><a href="#">Seatbelt Exemption</a></li>
<li><a href="#">Release of Information </a></li>
<li><a href="#">Volentry Code of Practise for Private Car Parking
Enforcment </a></li>
<li><a href="#">Your Legal Obligations as a Driver and / or Keeper of a
Vehicle </a></li>
<li><a href="#">Data Protection </a></li>
</ul>
</div>
<div class="relatedLinks">
<ul>
<li><a href="#">Site Map </a></li>
<li><a href="#">Contact Us </a></li>
<li><a href="#">Privacy Policy </a></li>
</ul>
</div>
</div>
<!--end navBar div -->
<!--end headlines -->
<div id="content">
<div class="feature">
<DIV style="FONT-WEIGHT: bold; FONT-SIZE: 17px; TEXT-ALIGN: center"
width="100%">
<form name="form2" method="post" action="">
Data Checker
</form>
</DIV>
<p>Please Enter Your Vehicle Details Below</p>
<p>Vehicle Registration Number
<input name="Reg" type="text" id="Reg">
(Required)
</p>
<p>Vehicle Make <input name="Make" type="text" id="Make">
</p>
<p>Vehicle Model
<input name="Model" type="text" id="Model">
</p>
<p>Vehicle Colour
<input name="Colour" type="text" id="Colour">
</p>
<p>Vehicle Engine <input name="Engine" type="text" id="Engine">
</p>
<p><a href="Data Checker 4.cfm">Proceed</a> </p>
<form name="form1" method="post" action="">
<input type="submit" name="Submit" value="Submit">
</form>
<p> </p>
<p>
<!--Make a Link to Terms and Conditions
-->
</p>
<p> </p>
<p><BR>
</p>
</div>
<div class="story"> </div>
</div>
<!--end content -->
<div id="siteInfo">
<div align="center"><a href="#">About Us</a> | <a href="#">Site
Map</a> | <a href="#">Privacy Policy</a> | <a href="#">Contact Us</a> |
©2003
Company Name </div>
</div>
<br>
</body>
</html>
Jabez Clegg Guest
-
Data from a DataBase
Does anyone have a sample class that returns data from a database query that can be used to populate a flex component using the dataprovider? Does it... -
Dobbellagring av data i database
Hei! Er det noen som har hatt problemer med at en datarad har blitt lagret dobblet opp i databasen, når den egentlig bare skulle ha lagret en... -
Import Data from flat-database to relational-database
Before I start I need some tips and pleas excuse my bad english. I have two databases, one is flat and one is a relational database. example ... -
NEWBIE HELP Import Data from flat-database to relational-database
I want to import Data from a simple Database, which contains all Information in one big record into a relational Database and split up the big... -
Display data from database in a scrollable data grid on an ASP Page
Hi All, I want to display data from database in a scrollable data grid on an ASP Page. I want to use it for entering data also. Should i have to... -
philh #2
Re: Getting Data From a Database
First of all, you need an action page for your form(s): <form name='form2'
method='post' action='[processing page name goes here]'> Secondly, you have
two forms. The information in these forms will not be submitted together. Are
you sure you need two? Your action page will take the submitted form info and
query the database for the information. So, for the registration query, you
would take the input from <input name='Reg' type='text' id='Reg'> and plug
it into a query: <cfquery name='getReg' datasource='#myDSN#'> SELECT * FROM
Vehicle WHERE car_registration = '#form.geg#' </cfquery> and display the
returned info with the CFOUTPUT tag. Be sure to check for record count so you
can display a 'No Records Found' notice if necessary. Read the LiveDocs, read
the posts on these Forums, and buy Forta's book. That's the best advice I can
give for the rest of the solution. Good luck and happy CFing,
philh Guest



Reply With Quote

