I am trying to compact and repair an Access Database (MS Access 2016). I did it several times in the past already, but this time, the compact and repair procedure is hanging. When i look at the temporary Database.mdb generated, I see that it hit 2 097 152 Kb. This is really strange as my uncompacted DB is only about 100 Mb.
Does anyone have a clue ?
Thank you,
Clément
I would create a new blank database, and try importing everything from the older one.
Also, don't try to compact + repair say on a network shared folder. Copy the accDB file local, and then do the c+r.
Related
I have a client with a reaaally old MDB which we didn't make and they can't contact the guy who did it and recently it started showing the error:
Cannot open database “. It may not be a database
that your application recognizes, or the file may be corrupt.
Even when I try to export all the tables it just keep showing the same error and if I try to Compact and Repair I get the error that I don't have permission to do so. I have tried with every single user on the computer. If I restore the previous version all new data will be lost and will just happen again eventually as it doesn't let me compact either and even if I try creating a new database or table in another database, it doesn't let me import the data into it.
I can read all the tables but can't even copy that information. I'm at a loss of what to do and they asked me to have it for tomorrow.
I will be thankful for any tip you can give me for solving this error
Edit:
I have tried opening the file with a newer access to see if I can compact and it doesn't let me enter with any user even though the MDW is the same
I solved it! And this is how:
I noticed that the database was about 1'99GB which is almost the size limit of an access database so I just needed to Compact and Repair but it didn't let me because of permissions...
The database had another extra user which we didn't see before for any reason, that user was not even an admin, he was the real user who created the database (even though it kept telling me everywhere that the database was made by the admin and that he was the propietary...)
Since compacting gave me an error that couldn't find the database "Tempmsysaccessobjects", I just had to google it and found the solution in a spanish forum where they recommended creating a new database and importing all old data and with this user it let me do it!
Thank guys for helping!
I have searched the net on this topic and found, that if an ms access database should be compacted, then I should give the database itself and a new path.
Why is this necessary? If I check in ms access, that it should compact the database after closing, it don't creates a compacted database and deletes the old one, but it compacts only the one database. Or it is so fast, that I can't see it?
Access creates the compacted db as a new file, deletes the old (uncompacted) db file, and renames the new file to the old name.
It always works that way regardless of whether you compact from external code, from within an active Access session, or with compact on close at the end of an Access session.
With a small enough db file, the entire process can complete so quickly that you might not notice the transitional new db file. But with a large enough db file --- 1 GB should do it --- you can watch in Windows Explorer as the new db file is created and grows to it final (compacted) size.
Incidentally, be cautious about compact on close. Many experienced Access developers recommend against that option. The reason is that if anything goes wrong during compact, the new db can be corrupted and your original uncompacted version will be gone ... so no hope of recovery.
I have received few files(.DBF) from client. Each files is of different size (ranging from 40 Kb to 2.2 Gb)
I am using MS VS Foxpro driver..Provider connection manager.
When I connect (to retrieve tables) to the folder where all there files are stored. In Table/View dropdown, I see all tables except the one with size > 2Gb.
I am able to reproduce this scenario in other systems as well.
Suppose, if the DBF file size is 1.5 Gb, the table shows up in dropdown.
Any help? Thanks in advance
The maximum size for a Visual FoxPro table or almost anything else is 2GB. So I would imagine that is your problem. A 64 bit driver will make no difference. I'm not sure how the client is creating files > 2GB either, unless they're using something other than Fox.
Take a look into SyBase Advantage Local Server. Sybase adapated there database to handle similar format of VFP and can read them directly and exceed the 2 gig file limit of 32-bit based applications. I've been using for some time having converted another system from VFP OleDB. Personally, I'm using C# with Sybase's Data Provider to connect to and read data. From that, you could probably get to what you are looking for.
Link for Sybase Local Server
It's royalty-free for local server and 2-concurrent-users for development/testing.
Ive got an mde file and all i need is to get data from tables of this file in any format... I've tried everything that I could find on the internet or get by myself, but nothing helps. When I am using standard tools for extracting data in access it says to me, that I have something running operations on that database( I think there is some kind of a macro or something else, that starts when I open this file).
If you have any info on how to get data from this file I will be SO thankfull!
Thaks again for your attention and I really sorry for my bad english(doing my best to learn speaking it better).
There are a few tricks you can try:
Press SHIFT when opening the file to disable autoExec macros.
Just in case the file is corrupted, try to compact and repair it (make a backup copy before!).
You can use the command line option /compact to perform the compact and repair without first opening the file.
You can create a new database and create linked tables from the other database.
You'll have the option of copying the whole tables (you may need to rename the .mde into .mdb so you can see it in the dialog asking for the file to link to).
I have a corrupt database. If I open it in MS Access, MS Access offers to repair it, and it succeeds.
How can I do that with code? On a machine where MS Access is not installed.
I know from trying it that JRO.JetEngine.CompactDatabase does NOT work.
In other words, I want to do what Access or JETCOMP.exe is doing, not what JRO.JetEngine.CompactDatabase is doing.
You need to go to http://support.microsoft.com and search for the JetComp.exe utility, which will attempt to repair and compact your MDB without opening the file. The reason none of the suggestions above work is because they have to open the MDB to do their work, whereas JetComp doesn't open the file, but operates on it structurally.
If it can't recover your file (which does happen), then you'll have to go to a data recovery service. I recommend Peter Miller of PKSolutions.com.
Command-line switch for opening a .mdb file:
/compact
It repairs and compacts the database file.
If you leave out a target file name following the /compact switch, the file is compacted to the original name and folder. To compact to a different name, specify a target file.
Have you tried DBEngine.RepairDatabase [my.mdb]? (which doesn't seem to work any more even when you reference an earlier version)
However, if is happening so often that you need to code it, you probably have a bigger problem you should be solving first.
If you are willing to use separate utility, how about the Jetcomp.exe utility (http://support.microsoft.com/kb/295334 ). It is supposed to "be able to recover some databases that the Microsoft Access compact utility and the CompactDatabase method cannot." In which case, all you need to do is execute the external application.
e.g.,
Call Shell("Jetcomp.exe <arguments>")
I'm not a MS Acccess guru, but it appears as though this utility contains the DLLs you'd need to compact and repair a corrupt database file.