Question Compact On Close creating default database copy

Autoeng

Why me?
Local time
Today, 03:58
Joined
Aug 13, 2002
Messages
1,302
I have a database that if I set the option to compact on close it is creating a default (db1.mdb, db2, db3, ect.) database copy. It does not do it if I do not compact on close.

The only code I have is an Autoexec module.

Code:
Option Compare Database

'------------------------------------------------------------
' Autoexec
'
'------------------------------------------------------------
Function Autoexec()

    DoCmd.SetWarnings False
    On Error Resume Next
    Kill "S:\mydirectory\tbl1009QA.xls"
    DoCmd.OpenQuery "qrytbl1009", acViewNormal, acEdit
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tblqry1009QA", "s:\mydirectory\tbl1009QA.xls"
    DoCmd.OpenTable "tbl1009QA", acViewNormal, acEdit
    DoCmd.Maximize
    DoCmd.GoToRecord , "", acNewRec
    DoCmd.SetWarnings True

End Function

The Excel file that it exports has 24,000 rows but only 4 columns. It does not have any problem exporting the file. When the database is closed however the database copies itself.

Any clue why?
 
So no one has ever seen this or knows where a selectable option might be that controls this?
 
I didn't see that start happening until Access 2007. When our office upgraded, our database was in '03 and the auto compact and repair created the duplicate.

I have since then moved the database into '07 (before I knew about the security workgroups bit) and have been writing code to cover the security bit. So far, I disabled and have been doing manually until I can effect a resolution.

-dK
 

Users who are viewing this thread

Back
Top Bottom