Access 2010 Error 3024

Posted on 2011-05-02
Last Modified: 2012-05-11
I am using an ACCDB Access 2010 database linked to SQL Server tables.  I have used “DoCmd.RunSQL” in many places to do updates with no problems but today I added another and this one always generates an error message saying “Error 3024 Could not find the file 'I:\...\dbo.mdb'.  After complaining it goes ahead and does the update anyway!?  The SQL string is “Update dbo.tbl_PO_PurchaseOrders Set Completed = -1 Where (PONumber = '0100-009001')” – the PO number is a variable. Needless to say “dbo.mdb” is not the name of the database – the name is wrong and the extension is ACCDB not MDB.  I found references on the web to the fact that this has something to do with it being an ACCDB not MDB database type.  Apparently the MDB uses DAO and the other uses ADO?
I can “solve” the problem using  “If Err.Number = 3024 Then Err.Clear  Resume Exit_Handler” - but why has the same code been working fine for 6 months and now it starts complaining – and then goes ahead and doing the update anyway?  I also tried making an ADODB connection with a connection string and using “conAccess.Execute SQL_Statement” and this complains about “You do not have exclusive access to the database at this time – if you proceed you may not be able to save changes” although it too does the update anyway.
Is there any way to get this to work consistently?
Question by:thresholds
    LVL 21
    What is the SQL you are attempting to run?
    LVL 84
    I'd advise you to make a backup of your database and then perform some maintenance. In 2010, you can Compact the database (click the File tab, and then the Compact button).

    If that doesn't work, you might try building a new, blank database and importing everything into that new database.

    Author Comment

    As mentioned in my original post the SQL I'm running is “Update dbo.tbl_PO_PurchaseOrders Set Completed = -1 Where (PONumber = '0100-009001')” with the actual PONumber being a variable – the SQL string is put together using VBA.  I know the SQL strings are put together correctly since I test them by using Debug.Print and then running the resulting SQL in the SQL server management studio (v 2008).  Plus, as I mentioned, the code actually does the update – it just keeps complaining about it.
    I have already made new databases and copied the old objects to the new one (doing a decompile first) and sometimes even deleting all of the code modules and then bringing in the old objects into a new database, adding the code back and proceeding from there.  This has worked (apparently) to solve some ODBC issues.  I have lost count of the number of times I have done a compact and repair.
    I’ll try making a new DB again but it sure seems to me that this stuff (Access DBs) is hyper sensitive and gets corrupted faster than a Chicago politician in heat.
    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    It might be just a network timing issue.
    ...or a function of the number of times the networks "Tries" to reach the destination.

    In Access you can play around with the Client settings, and see if that helps:


    Accepted Solution

    I'll give it a try - right now I am making a new DB and importing all objects.
    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    LVL 84
    It would seem my comment resolved your issue - i.e. build a new database and import everything to it. If you're looking for ways to stop constant corruption, then you should include that in your original post.

    As to stopping corruption - there are quite a few things that cause corruption. One is networking issues, as HTC suggests. Access requires a robust and healthy (and FAST) network. Using wireless, VPN, WAN etc etc networks is a recipe for disaster in most cases.

    Another big cause is "sharing" the same Access database among multiple users, especially if those users are running different versions of Access. In your case, you should deploy a COPY of the database to each user, and each user should run their copy from their local machine.


    Author Closing Comment

    Another corrupted database.  Again.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now