Guest_imported
New member
- Jan 1, 1970
- 0
Hello,<br>
<br>
I have written a procedure that automatically imports records from our mainframe then exports them to a differant table, it then deletes the old table data, and finally it renames the new tables. I was having problems with this method, as it kept saying the database had reached it's maximum size. I finally realized that I need to compact this database after each update, the problem is, I cannot seem to do this programmatically. The Code I am trying to use to do this is:<br>
<br>
'--------------------------------------------------------<br>
DoCmd.Close acForm, "AutoUpdate", acSaveNo<br>
DBEngine.CompactDatabase "\\Nt_server\driven\Secure IA\AutoUpdate.mdb", "\\Nt_server\driven\Secure IA\AutoUpdateC.mdb"<br>
'-------------------------------------------------------<br>
<br>
What happens when I run this code is that I get an <b>Error 3356</b> <span style=color:red>You attempted to open a database that is already opened exclusively by user <name> on machine <name>. </span>.<br>
<br>
What I am wondering is this, is there any way of actaully closing the database to do the compacting, from the code? It would see that if the database is closed, then the code is stopped.<br>
<br>
Any assistance would be greatly appreciated.<br>
<br>
TIA <p>John Vogel<br><a href=mailto:johnvogel@homepage.com>johnvogel@homepage.com</a><br><a href= HomePage</a><br>WebMaster - DataBase Administrator - Programmer<br>
<br>
I have written a procedure that automatically imports records from our mainframe then exports them to a differant table, it then deletes the old table data, and finally it renames the new tables. I was having problems with this method, as it kept saying the database had reached it's maximum size. I finally realized that I need to compact this database after each update, the problem is, I cannot seem to do this programmatically. The Code I am trying to use to do this is:<br>
<br>
'--------------------------------------------------------<br>
DoCmd.Close acForm, "AutoUpdate", acSaveNo<br>
DBEngine.CompactDatabase "\\Nt_server\driven\Secure IA\AutoUpdate.mdb", "\\Nt_server\driven\Secure IA\AutoUpdateC.mdb"<br>
'-------------------------------------------------------<br>
<br>
What happens when I run this code is that I get an <b>Error 3356</b> <span style=color:red>You attempted to open a database that is already opened exclusively by user <name> on machine <name>. </span>.<br>
<br>
What I am wondering is this, is there any way of actaully closing the database to do the compacting, from the code? It would see that if the database is closed, then the code is stopped.<br>
<br>
Any assistance would be greatly appreciated.<br>
<br>
TIA <p>John Vogel<br><a href=mailto:johnvogel@homepage.com>johnvogel@homepage.com</a><br><a href= HomePage</a><br>WebMaster - DataBase Administrator - Programmer<br>