Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Problem with Online ASP/MS Access

Options
  • 26-04-2005 7:14pm
    #1
    Registered Users Posts: 947 ✭✭✭


    <%
    Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db\users.mdb"))

    If Request("submit") = "Confirm Registration Details" Then
    sSQL = "INSERT INTO registered VALUES ('" & Request("Name") & "', '" & Request("Address") & "','" & Request("Email") & "')"
    Response.Write("SQL Query: " & sSQL & "<BR><BR>")
    oConn.Execute(sSQL)
    End If

    sSQL = "SELECT * FROM registered"
    set oRS = oConn.Execute(sSQL)
    %>
    <%
    oConn.Close
    Set oRS = Nothing
    Set oConn = Nothing
    %>

    <p>Add a customer</p>
    <form method="GET" action="signup.asp">
    <p>Name:<input type="text" name="Name" size="20"></p>
    <p>Address: <input type="text" name="Address" size="20"></p>
    <p>Email: <input type="text" name="Email" size="20"></p>


    <p><input type="submit" value="Confirm Registration Details" name="submit"></p>
    </form>
    </font>


    Ok, not sure if this is the best place for this problem but I couldnt find an exact forum for my question so this is it!!

    I have a website that uses ASP code(above) to enter information from the user on the website in text boxes, however I am getting an error.

    "Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xc3c Thread 0xe8 DBC 0x2685014 Jet'.

    /LanceStorm/project/signup.asp, line 26"

    from what ive gathered from google, this means either my path to the database is incorrect(which it isnt), or my privilages arent set right!?(which I have no idea what that means).

    I think its just a problem with the code and if anyone can have a look and have a shot at an answer or ideas then please do!!

    Thanks in advance to anyone that gives it a shot!!


Comments

  • Moderators, Politics Moderators Posts: 39,765 Mod ✭✭✭✭Seth Brundle


    I see a few things:-
    * you should always use OPTION EXPLICIT at the top
    * you have an if statement that generates the SQL. However you still execute it if Request("submit") = "Confirm Registration Details" is not true.
    * Server.MapPath("db\users.mdb")) should read Server.MapPath("db/users.mdb"))


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    kbannon wrote:
    I see a few things:-
    * Server.MapPath("db\users.mdb")) should read Server.MapPath("db/users.mdb"))

    "db\\users.mdb" should also be valid, no?


  • Moderators, Politics Moderators Posts: 39,765 Mod ✭✭✭✭Seth Brundle


    it can actually with just one back slash, not two - I was thinking of something else earlier.


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    You should make sure you have the latest version of DAO installed, it should be on the Microsoft website, maybe MDAC aswell I can't remember now, if you look up both of them on the microsoft download site you should be able to see which ones you need.

    You should also try putting "uid=admin;pwd=admin" into you connection string, they're the defaults for access databases.

    If neither of the above work you could try a DSN based connection. In the control panel (or in administrative tools depending on OS) on your webserver there should be an ODBC applet, go into that and on the System DSN tab choose add. Pick the microsoft access driver, then choose a name for your DSN and select the database. Then change your top two lines to something like
    Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.Open("DSN=myDSN;uid=admin;pwd=admin"))
    
    replacing myDSN with whatever you called yours.

    edit: the problem with using a DSN is that you obviously need to have it on every webserver you want to run your application from.


  • Registered Users Posts: 2,781 ✭✭✭amen


    I think the first thing you have to try (on your local machine)
    is take the SQL and run it access does it work ?
    if so then just create a simple page and see if you can pull data from the data base then try the insert
    I think your real problem is a security issue on the access db
    what user credentials are you using in IIS and do they have access to MS Access ?


  • Advertisement
Advertisement