Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form/html not working properly?

    Been using this as template for order tracking form. But it doesn't seem to work properly. Anyone know why?

    Many thanks for the help

    Kind regards,

    Jay


    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Order Tracking</title>
    </head>
    <body>


    <%
    '**********************************************************************************
    ' This script retrieves the ORDER TRACKING, given a customer
    '**********************************************************************************
    Dim yourID, rs
    registration_CustomerID = 1
    '**********************************************************************************
    ' Hey! This customerID can be retrieved from the Session object, once the customer is logged in!!
    '**********************************************************************************

    response.Write("Thank you for submitting your details <br>")
    'path to the database

    pathToDb = "e:\isproot\yr0708\BN3369\Group-14\registration.mdb"
    response.write("The status of your orders are summarised in the below table - <br>")
    response.write("<br>")

    'Open the database
    set db= Server.CreateObject("ADODB.Connection")
    dbId = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & pathToDb & ";UID=;PWD="
    db.Open dbId

    'All this boring stuff of the database you already know....
    'And of the recordset as well.....
    set rs = server.createObject("ADODB.Recordset")

    'Define the query needed to find the required data: THIS IS THE BIT THAT MATTERS!
    'I've concatenated the SQL statement, just to look nice in Notepad++
    SQL = "SELECT UserAccount.Email, UserAccount.CustomerID, OrderTracking.OrderID, OrderTracking.BeginDate, OrderTracking.EndDate, OrderTracking.Operation "
    SQL = SQL & "FROM UserAccount, tbl_Order, OrderTracking WHERE "
    SQL = SQL & "UserAccount.CustomerID = " & registration_CustomerID & " AND UserAccount.CustomerID=tbl_Order.CustomerID AND "
    SQL = SQL & "tbl_Order.OrderID = OrderTracking.OrderID"

    'Fill the recordset with the data defined by the query:
    rs.open SQL,db, 2, 2
    response.Write("If any of the details below seem to be incorrect, please contact us as soon as possible<br>")
    'rs.MoveFirst
    Response.Write ("<table border = " & chr(34) & "= " & "1" & chr(34) & ">")
    Response.Write("<tr>")
    Response.Write("<td> Order ID </td><td> Order Placed </td><td> Status </td>")
    Response.Write("</tr>")
    While Not RS.EOF
    Response.Write("<tr>")
    Response.Write("<td>" & rs("OrderID") & "</td><td>" & rs("BeginDate") & "</td><td>" & rs("Operation") & "</td>")
    Response.Write("</tr>")
    rs.MoveNext
    wEnd
    Response.Write("</table>")
    'Close the recordset and the database
    rs.Close
    response.Write("Closing recordset..")
    db.close
    response.Write("Closing database..")

    %>
    </body>
    </html>

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    This isn't an HTML problem. You're using ASP to pull records from a database and something isn't working in the process.

    To get better help you need to describe exactly what isn't working, what you expect to happen, etc. The more information you can provide, the better.

    Edit: Moving to ASP…
    Last edited by rmedek; 01-11-2008 at 06:31 PM.


  •  

    Posting Permissions

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