+ Reply to Thread
Results 1 to 7 of 7

Run-time error '-2147467259 (80004500)' - VBA for Access dbase update

  1. #1
    Registered User
    Join Date
    10-20-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    40

    Run-time error '-2147467259 (80004500)' - VBA for Access dbase update

    Hey guys,

    A little bit of how my set goes. First, I have an access database that stores the employee information as well as call metric goals. I use a VBA script to pull certain agents based on a few parameters into a table. What I need to happen is, if any data is changed in that same table, such as, an employees metric goal is adjusted, I need it to updated on the access database table. Here is the script I am using. I'm using Excel and Access 2013.

    Please Login or Register  to view this content.
    Now, I get the feeling I'm using the wrong strConn/reference in this script, like it's looking for sql and not access library. When I change something in the table, I get this gnarly error message:

    Run-time error '-2147467259 (80004500)' Unrecognized database format.

    Any ideas why or what I can do to make this work?

  2. #2
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Run-time error '-2147467259 (80004500)' - VBA for Access dbase update

    Hi baijixu,

    Kindly check your connection string, you are using Jet OLEDB provider to connect to ACCDB file.
    Try to use the following connection string :

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=A:\AccessFile.accdb;
    Persist Security Info=False;


    You can check this link for further info :
    http://msdn.microsoft.com/en-us/library/cc280478.aspx


    Regards,
    Paresh J
    Last edited by pareshj; 06-07-2014 at 01:57 AM.
    Click on "* Add Reputation" as a way to say thanks

  3. #3
    Registered User
    Join Date
    10-20-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Run-time error '-2147467259 (80004500)' - VBA for Access dbase update

    This works:

    Please Login or Register  to view this content.
    However, is there a way to make this a button click-able macro that updates the entire table at once rather than have it update each time a field is changed?

  4. #4
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Run-time error '-2147467259 (80004500)' - VBA for Access dbase update

    Hi baijixu,

    Yes you can. Just follow the below steps :
    1) Select the sheet where you want to place the button.
    2) Go to Developer Tab > Insert > Under ActiveX Controls add CommandButton control on sheet.
    3) Then Just double click the commandbutton, it will open up VBE editor in order to place your VBA code.
    4) Just copy paste the code to CommandButton_Click function.

    Note : If you dont see Developer Tab on your menu,
    Go to Microsoft Office Icon at the Top left > Click Excel options > Under Popular option > Just check the "Show Developer Tab in the Ribbon" option.


    Regards,
    Paresh J

  5. #5
    Registered User
    Join Date
    10-20-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Run-time error '-2147467259 (80004500)' - VBA for Access dbase update

    Please Login or Register  to view this content.
    Okay I have added the button and the code. I edited some fields and clicked the button and got this error:
    "Run-time error '424' Object Required" and the debug is highlighting For Each rng In Target.Rows

  6. #6
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Run-time error '-2147467259 (80004500)' - VBA for Access dbase update

    Hi,

    You need to define your Target range. Check the following code:

    Sub Worksheet_Change(ByVal Target As Range)

  7. #7
    Registered User
    Join Date
    10-20-2013
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Run-time error '-2147467259 (80004500)' - VBA for Access dbase update

    Pareshj, you have been a huge help and I thank you! Honestly, I know very little of VBA and I've been at this for over 12 hours.

    Here is the script I am using now, it seems to be working!

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Run time error'-2147467259(80004005)':
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2014, 12:27 AM
  2. run-time error '-2147467259(80004005)':
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-02-2014, 03:46 AM
  3. [SOLVED] Run-time error '-2147467259(80004005)'
    By Lloyd Blankfein in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-14-2013, 01:52 PM
  4. Excel 2010 Run Time Error '-2147467259 (80004005)'
    By jdpeterson72 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2012, 06:52 PM
  5. [SOLVED] Run time error '-2147467259 (80004005) adding icon
    By DMc2005 in forum Excel General
    Replies: 3
    Last Post: 10-02-2005, 12:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1