Results 1 to 2 of 2

Thread: Query to Access database thru .ASP using SQL

  1. #1
    Join Date
    Mar 2007
    Posts
    8

    RESOLVED (I think) - Query to Access database thru .ASP using SQL

    If this works when I'm done, I'll be glad to share the code with everyone. Here's my search page below.

    Running Events

    The Action on this page/form is set to 'getresults.asp'. The database is 'mydatabase.mdb'. I need the Sql search to go into the database, based on the search terms entered. The results page will show a thumbnail(s) of the picture of the racer. My current package with the hosting company doesn't include support for PHP.

    Code for 'getresults.asp' from my hosting company:

    <html>
    <title>Database query using ASP</title>
    <body bgcolor="FFFFFF">
    <h2>Query table <b>Products</b> with ASP</h2>
    <%
    Set dbaseConn = Server.CreateObject("ADODB.Connection")
    dbaseConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("\db\mydatabase.mdb") & ";"
    SQLQuery = "SELECT * FROM PRODUCTS"
    Set RS = dbaseConn.Execute(SQLQuery)
    %>
    <%
    Do While Not RS.EOF
    %>
    <%=RS("name")%>, <%=RS("description")%>, <%=RS("price")%> DM
    <p>
    <%
    RS.MoveNext
    Loop
    RS.Close
    Set RS = Nothing
    dbaseConn.Close
    Set dbaseConn = Nothing
    %>
    </body>
    </html>


    Any feedback or suggestions are appreciated.
    Thank you
    Last edited by JeratBP; 22 Mar 2007 at 09:51 AM. Reason: solution found

  2. #2
    Join Date
    Mar 2007
    Posts
    8
    Possibly resolved issue, see link to the tutorial:

    http://authors.aspalliance.com/glenncook/searchcode.asp

    I'll find out tonight if it resolves my issue.

Similar Threads

  1. date format to access database
    By numbenator in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 01 Jan 2006, 10:56 AM
  2. Help with variable Scopes in PHP and database access
    By LithMaster in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 23 Aug 2005, 03:29 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
  •