nightmare day - Cannot get connect to Access DB using ASP page

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default nightmare day - Cannot get connect to Access DB using ASP page

    having day from hell

    i have db called dbproduct.mdb (its Microsoft Access) it has one table
    (tbl_products)

    my page is in wwwroot, called products.asp

    my db is in db (up one from wwwroot - so if html link from file in
    wwwroot would be ..\db\ etc - sorry if teaching to suck eggs)

    i just need to connect and get the data - once i have done that i will
    be able to do all the other stuff i need to do... but am having no
    luck in connecting.


    here is my code.... its a complete mess cos i have been trying so many
    different things!!!

    please some one help me!!!


    httpL//www.buffyslay.co.uk




    <%
    Option Explicit
    Dim conn
    Dim RS


    Set conn = Server.CreateObject("ADODB.Connection")
    demoFilePath = "..\db\dbproduct.mdb"
    conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
    demoFilePath & ";"

    set RS = conn.execute("select * from tbl_product")

    %>
    <table border="1">
    <tr>
    <td>id</td>
    <td>Make</td>
    <td>Model</td>
    <td>Specification</td>
    <td>picture1</td>
    <td>picture2</td>
    <td>List Price</td>
    <td>Our Price</td>
    <td>Lease Per Day</td>
    </tr>
    <%
    Do While Not RS.EOF
    %>
    <tr>
    <td><%= RS.Fields("id").Value %></td>
    <td><%= RS.Fields("Make").Value %></td>
    <td><%= RS.Fields("Model").Value %></td>
    <td><%= RS.Fields("Specification").Value %></td>
    <td><%= RS.Fields("picture1").Value %></td>
    <td><%= RS.Fields("picture2").Value %></td>
    <td><%= RS.Fields("List Price").Value %></td>
    <td><%= RS.Fields("Our Price").Value %></td>
    <td><%= RS.Fields("Lease Per Day").Value %></td>
    </tr>
    <%
    RS.MoveNext
    Loop
    %>
    </table>
    <%
    ' Close our recordset and connection and dispose of the objects
    RS.Close
    Set RS = Nothing
    conn.Close
    Set conn = Nothing


    %>
    Buffyslay_co_uk Guest

  2. Similar Questions and Discussions

    1. connect to access DB
      Hi, We have Cold Fusion server running on Solaris. I need to connect to Microsoft Access DB witch is on the different server. Is anybody could...
    2. How best to connect MS Access and Solaris CF 6.1?
      I've got a request to connect my Solaris ColdFusionMX 6.1 server to an MS Access database. But apparently MS Access just talks ODBC and I see no...
    3. How to use “RDS.Connect” to connect to a MS Access database?
      The example I am working from uses the following code which does not work: RDS.Connect = "Provider='sqloledb';Integrated Security='SSPI';Initial ...
    4. how can i connect with an access database
      i need to work with an mdb file which contains a lot of data that might be change a lot of times and must stay an mdb file (so i cant make this file...
    5. Connect to Access db from VC#
      Hi all, I'm trying to connect to an MS Access database using ADO.NET and C#, but I'm getting the dreaded "Microsoft Jet database engine cannot...
  3. #2

    Default Re: nightmare day - Cannot get connect to Access DB using ASP page

    Any error message ?
    If something like 80004005 see [url]http://www.aspfaq.com/show.asp?id=2009[/url]

    "Buffyslay_co_uk" <oogle@buffyslay.co.uk> a écrit dans le message de news:
    [email]dea9d481.0307280556.d4daebf@posting.google.com[/email]...
    > having day from hell
    >
    > i have db called dbproduct.mdb (its Microsoft Access) it has one table
    > (tbl_products)
    >
    > my page is in wwwroot, called products.asp
    >
    > my db is in db (up one from wwwroot - so if html link from file in
    > wwwroot would be ..\db\ etc - sorry if teaching to suck eggs)
    >
    > i just need to connect and get the data - once i have done that i will
    > be able to do all the other stuff i need to do... but am having no
    > luck in connecting.
    >
    >
    > here is my code.... its a complete mess cos i have been trying so many
    > different things!!!
    >
    > please some one help me!!!
    >
    >
    > httpL//www.buffyslay.co.uk
    >
    >
    >
    >
    > <%
    > Option Explicit
    > Dim conn
    > Dim RS
    >
    >
    > Set conn = Server.CreateObject("ADODB.Connection")
    > demoFilePath = "..\db\dbproduct.mdb"
    > conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
    > demoFilePath & ";"
    >
    > set RS = conn.execute("select * from tbl_product")
    >
    > %>
    > <table border="1">
    > <tr>
    > <td>id</td>
    > <td>Make</td>
    > <td>Model</td>
    > <td>Specification</td>
    > <td>picture1</td>
    > <td>picture2</td>
    > <td>List Price</td>
    > <td>Our Price</td>
    > <td>Lease Per Day</td>
    > </tr>
    > <%
    > Do While Not RS.EOF
    > %>
    > <tr>
    > <td><%= RS.Fields("id").Value %></td>
    > <td><%= RS.Fields("Make").Value %></td>
    > <td><%= RS.Fields("Model").Value %></td>
    > <td><%= RS.Fields("Specification").Value %></td>
    > <td><%= RS.Fields("picture1").Value %></td>
    > <td><%= RS.Fields("picture2").Value %></td>
    > <td><%= RS.Fields("List Price").Value %></td>
    > <td><%= RS.Fields("Our Price").Value %></td>
    > <td><%= RS.Fields("Lease Per Day").Value %></td>
    > </tr>
    > <%
    > RS.MoveNext
    > Loop
    > %>
    > </table>
    > <%
    > ' Close our recordset and connection and dispose of the objects
    > RS.Close
    > Set RS = Nothing
    > conn.Close
    > Set conn = Nothing
    >
    >
    > %>

    Patrice FRITSCH Guest

  4. #3

    Default Re: nightmare day - Cannot get connect to Access DB using ASP page

    Try this

    demoFilePath = Server.MapPath( "..\db\dbproduct.mdb")




    "Buffyslay_co_uk" <oogle@buffyslay.co.uk> wrote in message
    news:dea9d481.0307280556.d4daebf@posting.google.co m...
    > having day from hell
    >
    > i have db called dbproduct.mdb (its Microsoft Access) it has one table
    > (tbl_products)
    >
    > my page is in wwwroot, called products.asp
    >
    > my db is in db (up one from wwwroot - so if html link from file in
    > wwwroot would be ..\db\ etc - sorry if teaching to suck eggs)
    >
    > i just need to connect and get the data - once i have done that i will
    > be able to do all the other stuff i need to do... but am having no
    > luck in connecting.
    >
    >
    > here is my code.... its a complete mess cos i have been trying so many
    > different things!!!
    >
    > please some one help me!!!
    >
    >
    > httpL//www.buffyslay.co.uk
    >
    >
    >
    >
    > <%
    > Option Explicit
    > Dim conn
    > Dim RS
    >
    >
    > Set conn = Server.CreateObject("ADODB.Connection")
    > demoFilePath = "..\db\dbproduct.mdb"
    > conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
    > demoFilePath & ";"
    >
    > set RS = conn.execute("select * from tbl_product")
    >
    > %>
    > <table border="1">
    > <tr>
    > <td>id</td>
    > <td>Make</td>
    > <td>Model</td>
    > <td>Specification</td>
    > <td>picture1</td>
    > <td>picture2</td>
    > <td>List Price</td>
    > <td>Our Price</td>
    > <td>Lease Per Day</td>
    > </tr>
    > <%
    > Do While Not RS.EOF
    > %>
    > <tr>
    > <td><%= RS.Fields("id").Value %></td>
    > <td><%= RS.Fields("Make").Value %></td>
    > <td><%= RS.Fields("Model").Value %></td>
    > <td><%= RS.Fields("Specification").Value %></td>
    > <td><%= RS.Fields("picture1").Value %></td>
    > <td><%= RS.Fields("picture2").Value %></td>
    > <td><%= RS.Fields("List Price").Value %></td>
    > <td><%= RS.Fields("Our Price").Value %></td>
    > <td><%= RS.Fields("Lease Per Day").Value %></td>
    > </tr>
    > <%
    > RS.MoveNext
    > Loop
    > %>
    > </table>
    > <%
    > ' Close our recordset and connection and dispose of the objects
    > RS.Close
    > Set RS = Nothing
    > conn.Close
    > Set conn = Nothing
    >
    >
    > %>

    DaWoE Guest

  5. #4

    Default Re: nightmare day - Cannot get connect to Access DB using ASP page

    You could also try using a DSN to connect, which is often much easier when
    first starting out

    --
    Joe Resudek
    Frontier New Media
    225 Crummer Lane
    Reno, NV 89509
    (775) 824-4040
    (775) 824-4044 fax
    [url]http://www.thefrontiergroup.com[/url]
    "Buffyslay_co_uk" <oogle@buffyslay.co.uk> wrote in message
    news:dea9d481.0307280556.d4daebf@posting.google.co m...
    > having day from hell
    >
    > i have db called dbproduct.mdb (its Microsoft Access) it has one table
    > (tbl_products)
    >
    > my page is in wwwroot, called products.asp
    >
    > my db is in db (up one from wwwroot - so if html link from file in
    > wwwroot would be ..\db\ etc - sorry if teaching to suck eggs)
    >
    > i just need to connect and get the data - once i have done that i will
    > be able to do all the other stuff i need to do... but am having no
    > luck in connecting.
    >
    >
    > here is my code.... its a complete mess cos i have been trying so many
    > different things!!!
    >
    > please some one help me!!!
    >
    >
    > httpL//www.buffyslay.co.uk
    >
    >
    >
    >
    > <%
    > Option Explicit
    > Dim conn
    > Dim RS
    >
    >
    > Set conn = Server.CreateObject("ADODB.Connection")
    > demoFilePath = "..\db\dbproduct.mdb"
    > conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
    > demoFilePath & ";"
    >
    > set RS = conn.execute("select * from tbl_product")
    >
    > %>
    > <table border="1">
    > <tr>
    > <td>id</td>
    > <td>Make</td>
    > <td>Model</td>
    > <td>Specification</td>
    > <td>picture1</td>
    > <td>picture2</td>
    > <td>List Price</td>
    > <td>Our Price</td>
    > <td>Lease Per Day</td>
    > </tr>
    > <%
    > Do While Not RS.EOF
    > %>
    > <tr>
    > <td><%= RS.Fields("id").Value %></td>
    > <td><%= RS.Fields("Make").Value %></td>
    > <td><%= RS.Fields("Model").Value %></td>
    > <td><%= RS.Fields("Specification").Value %></td>
    > <td><%= RS.Fields("picture1").Value %></td>
    > <td><%= RS.Fields("picture2").Value %></td>
    > <td><%= RS.Fields("List Price").Value %></td>
    > <td><%= RS.Fields("Our Price").Value %></td>
    > <td><%= RS.Fields("Lease Per Day").Value %></td>
    > </tr>
    > <%
    > RS.MoveNext
    > Loop
    > %>
    > </table>
    > <%
    > ' Close our recordset and connection and dispose of the objects
    > RS.Close
    > Set RS = Nothing
    > conn.Close
    > Set conn = Nothing
    >
    >
    > %>

    Joe Resudek Guest

  6. #5

    Default Re: nightmare day - Cannot get connect to Access DB using ASP page

    You can't use .. to go UP from the root because the root is as high as
    you can get. But you can get the physical path of the root by putting
    up a dummy page with just:
    Response.Write "Server.MapPath with . : " & Server.MapPath(".") & "<br>"

    And then you should be able to figure out the physical path of one up
    from that pretty easily...

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Developer
    [url]http://www.Bullschmidt.com[/url]
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Bullschmidt 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