Getting Data From a Database

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default 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">&nbsp;</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>&nbsp; </p>
    <p>
    <!--Make a Link to Terms and Conditions
    -->
    </p>
    <p>&nbsp;</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> |
    &copy;2003
    Company Name </div>
    </div>
    <br>
    </body>
    </html>









    Jabez Clegg Guest

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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 ...
    4. 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...
    5. 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...
  3. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139