devxlogo

Copying a Database

Copying a Database

Question:
What’s an easy way to make a copy of a currently open database? I’ve got open recordsets all over the place that I don’t want to close.

Answer:
Simply use theCompactDatabase method on the DBEngine object, oralternatively the CompactDatabase statement. ThisREQUIRES copying the database file to a new file,and has the added effect of compacting records,removing deleted records, and otherwise making fora cleaner copy.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist