Navigation:  Samples > Visual Studio >

Analyze.bld Sample

Previous pageReturn to chapter overviewNext page

This sample demonstrates automating the process of running the Analyze tool on a SourceSafe database to fix inconsistencies in the database.

 

The DB_PATH project macro stores the local path to the database to be analyzed, and the SHARE_NAME macro stores the name of the share used to make the database accessible to users. This can be modified, or passed in on the command-line when calling the project from a scheduled build.

 

First, the database is locked, users are notified that the database will be taken down for maintenance; after three minutes, the network share to the database is broken.  The data directory is then backed up, and analyze is called 1 to 3 times to correct any errors, with all analyze output being written to the VisBuildPro log.  Finally, the database is unlocked, a notification is sent to all users that the database is available, and an email with the log and success/failure message is sent to the administrator.

 

Analyze should always be run locally on the VSS server database, not over the network.  It can be scheduled to run automatically via Scheduled Tasks.

 

Note: This sample project is located in the Visual Studio subfolder of the Samples path.