Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

Automate compacting Access 97 mdb

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steven - 04 Nov 2006 23:41 GMT
I am trying:

Dim DBName, NewDBName as String
DBName = "C:\Files\ExampleFile.mdb"
NewDBName = "C:\Files\NewFile.mdb"

DBEngine.CompactDatabase DBName, NewDBName

but the DBName file has a password and therefore I keep getting an error
message, "Not a valid password".  The password is "accessgranted"

How do I code this so it will proceed with the compact.

Thank you for you help.

Steven
Granny Spitz - 05 Nov 2006 01:08 GMT
> Dim DBName, NewDBName as String

If you *don't* explicitly assign a data type to DBName (as it hasn't been in
this line of code), DBName will be a variant.

> How do I code this so it will proceed with the compact

DBEngine.CompactDatabase DBName, NewDBName, dbLangGeneral &
";pwd=accessgranted", , ";pwd=accessgranted"
Steven - 05 Nov 2006 03:06 GMT
You have done it again.

Thank you very much.
Granny Spitz - 06 Nov 2006 02:56 GMT
> Thank you very much.

You're welcome, Steven.  Good luck with your project.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.