D
dhstein
I've been experiencing a problem that I thought was a symptom of a corrupt
database, but now I'm not so sure. The database works fine in normal
situations. However, if I compact and repair, then I get 1 specific error in
1 function. The code that executes is below:
Private Sub MakeCostChangeTable()
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM tblCostChanges;"
DoCmd.RunSQL "INSERT INTO tblCostChanges SELECT * FROM qryCostChanges;"
DoCmd.SetWarnings True
End Sub
The arrow (on debug) points to the INSERT INTO statement
The error I get is:
Run-time error '3049':
Cannot open database ". It may not be a database that your application
recognizes, or the file may be corrupt.
So I put back the backup copy before the Compact and repair and everything
works fine - including the code above. So at this point, I'm trying to
figure out how to proceed. Can anyone see anything wrong with the code above
that might cause a problem after a Compact and Repair? Thanks for any help
on this.
database, but now I'm not so sure. The database works fine in normal
situations. However, if I compact and repair, then I get 1 specific error in
1 function. The code that executes is below:
Private Sub MakeCostChangeTable()
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM tblCostChanges;"
DoCmd.RunSQL "INSERT INTO tblCostChanges SELECT * FROM qryCostChanges;"
DoCmd.SetWarnings True
End Sub
The arrow (on debug) points to the INSERT INTO statement
The error I get is:
Run-time error '3049':
Cannot open database ". It may not be a database that your application
recognizes, or the file may be corrupt.
So I put back the backup copy before the Compact and repair and everything
works fine - including the code above. So at this point, I'm trying to
figure out how to proceed. Can anyone see anything wrong with the code above
that might cause a problem after a Compact and Repair? Thanks for any help
on this.