Results 1 to 5 of 5
  1. #1
    tomb is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    3

    File size increases until the macro gives me error 3049(corrupt)

    So I have an access macro which runs two vba functions 10 times. Its supposed to import a messy text file, convert it into a table, take certain columns into a query to then export it into an excel sheet. Before I run the code the file is about 300,000 KB, as it is running it gets through 8 of the imports/exports before the file goes over 2,000,000 kb and error 3049 (One more reason that makes this error happens is the file size limit is 2 GB and if you try to add data which get exceeds with 2 GB limit.) Also, I have it clear the two tables (I haven't tried clearing anything with my query tables just actual tables) during every iteration of the macro. HOW DO I FIX THIS!!!!!!!! Thank you in advance because I have no clue from here how to save this memory.

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    You do not need to import the text files in order to process them/import to Access tables.
    Instead link to them which will prevent the file bloat issue you have now.

    Having said that, if the sole purpose is to export to Excel, do you need Access at all?

    Assuming you do need Access, make sure you have a system for regularly backing up your database
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    What are the details of how your application is structured? Is it split, with the back end (tables) in a separate file?

    You have two potential problems here;

    1) The amount of data. If you are importing large amounts of data then you may be able to solve your problem by either splitting the application (if it's not already split - hopefully it is), or, breaking the back end up into separate files. You can link to multiple different back end files, and each would have it's own 2gb limit.

    2) Front end bloat due to the overhead of all your import/export processing. You solve this by doing a compact & repair.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Another option....

    You could read in the text file line by line, processing each line and writing the processed line back out to a different text file.

    Or use Excel to process the text file. Process the text file using VBA and write directly to a worksheet.


    It would be interesting to see the dB and the "messy" text file........ care to post it?

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Tomb
    I'm also intrigued by what these messy text files might be.
    Are they by any chance JSON or XML files from online sources?
    If these are JSON, I may have a better solution for you.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 04-01-2016, 10:38 AM
  2. Access - Run Time Error 3049
    By pfarley1212 in forum Access
    Replies: 2
    Last Post: 06-24-2013, 12:06 AM
  3. Fixing run-time error 3049
    By kthakk4 in forum Programming
    Replies: 1
    Last Post: 09-30-2011, 07:37 AM
  4. Corrupt Access file
    By Paul-NY in forum Access
    Replies: 6
    Last Post: 06-24-2011, 03:33 AM
  5. Replies: 5
    Last Post: 06-12-2011, 07:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums