Deleting Table Contents in a different file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Without linking to another database, how do you delete the contents of a
table in one database as part of a process in a second database?
 
Chase said:
Without linking to another database, how do you delete the contents of a
table in one database as part of a process in a second database?


A rather dangerous thing to do so make sure you have made a
copy of the other mdb file first.

You can use the IN phrase in a Delete query's From clause:

DELETE *
FROM thetable
IN "pathtoothermdb"
 
Thanks but I get the following error 3131 Syntax error in FROM clause.
hears the code
StrSQL = "DELETE tblPropertyCopy.* FROM tblPropertyCopy
IN C:\VolumeDatabase\WarehousePropertyCopy.mdb;"

CurrentDb.Execute StrSQL
 
You forgot the quotes around the path:

StrSQL = "DELETE tblPropertyCopy.* FROM tblPropertyCopy
IN ""C:\VolumeDatabase\WarehousePropertyCopy.mdb"""

BTW, an obscure, archaic, alternative syntax is:

StrSQL = "DELETE tblPropertyCopy.* FROM " & _

"[C:\VolumeDatabase\WarehousePropertyCopy.mdb].tblPropertyCopy"
 
Back
Top