Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    6
    Member #
    28374
    We recently updated from Office 2003 to 2010 and the Access Database was updated, and this has caused problems with updating a website, the code used in the original was:

    <%
    DIM objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
    Server.MapPath ("proposals.accdb") & ";"
    objConn.Open
    %>
    <%
    DIM objRS
    set objRS = Server.CreateObject("ADODB.Recordset")
    objRS.Open "policies", objConn, adLockOptimistic, adCmdTable

    objRS.AddNew
    objRS("FullName") = request.form("name")
    objRS("Email") = request.form("email")
    objRS("Start") = request.form("startdate")
    objRS("Expiry") = request.form("expirydate")
    objRS("Premium") = request.form("premium")
    objRS("Cover") = request.form("cover")
    objRS("Number") = request.form("number")
    objRS.Update

    objRS.Close
    Set objRS = Nothing
    objConn.Close
    Set objConn = Nothing
    %>

    But an error message appears stating the database (.accdb) cannot be recognised.

    So I downloaded the new ACE database engine from microsoft, changed the code to read:-

    <%
    DIM objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & _
    Server.MapPath ("proposals.accdb") & ";"
    objConn.Open
    %>
    <%
    DIM objRS
    set objRS = Server.CreateObject("ADODB.Recordset")
    objRS.Open "policies", objConn, adLockOptimistic, adCmdTable

    objRS.AddNew
    objRS("FullName") = request.form("name")
    objRS("Email") = request.form("email")
    objRS("Start") = request.form("startdate")
    objRS("Expiry") = request.form("expirydate")
    objRS("Premium") = request.form("premium")
    objRS("Cover") = request.form("cover")
    objRS("Number") = request.form("number")
    objRS.Update

    objRS.Close
    Set objRS = Nothing
    objConn.Close
    Set objConn = Nothing
    %>
    but the line "objRS.Open "policies", objConn, adLockOptimistic, adCmdTable" needs correcting, so I need help with the changes.

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    So are you working on the server or ???

    Since you said you downloads the driver, I'm assuming you are talking about working directly on the server.

    Your code is correct, is the new driver showing up in the ODBC listing ? If not you will need to add that driver to the ODBC listing.

    If its in the ODBC listing, try using a full physical path instead of the server map path function.

  4. #3
    Junior Member
    Join Date
    Jul 2011
    Posts
    6
    Member #
    28374
    The set-up is currently being tested on a local server that comes with XP

  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Typically, drivers for office products are installed if and when you install the office... That particular DB driver comes with office 2007 , but it can be downloaded and installed seperately so you don't actually have to burn a liscense just to have the driver.

    I see that is an INSERT STATEMENT... Although it may work, standard SQL Works better ( in my experince ).

    If this is a limited application ( less than 10 simultaneous connection ), youll probably on OK using msaccess, but if you see this application growing in use, you may want to consider something more scable, and reliable... All DB's use record locking, and msaccess has probably the worst record for handling records locks efficiently ( why I say less than 10 connections )

    You should investigate and consider moving to SQL or MySQL if this thing grows much.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:48 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com