May 12, 2010

Surround SCM and Microsoft Access Integration

Surround SCM
Surround SCM supports integration with Microsoft Access. SCC integration within Access is implemented through the Microsoft Source Code Control Interface (MSSCCI).  You’ll also need the Access source code control add-in. The Microsoft Office plug-in is optionally installed during the Surround SCM Client installation. If you did not install it initially, rerun the client installer. When you start Access, the Surround SCM connection is automatically configured. You can also configure the connection manually.

Configuring the Surround SCM connection

When you start Microsoft Access, the Surround SCM Server address, port, username and password are retrieved from the registry. If the connection is not successful or you want to switch to another server you can manually configure the connection.
  1. In Microsoft Access application, choose Surround SCM > Configure Connection.
  2. Select a Server, then enter your Surround SCM Username and Password. Select Always login with this username and password to store the information in the registry. You will be automatically connected when you start the application.
  3. Click Connect. You are now logged in and ready to start using Surround SCM.

Installing the Access source code control add-in

You must install the Access source code control add-in to enable communication with Surround SCM.

Performing Surround SCM actions in Access

The following Surround SCM commands can be accessed from the Source Control menu or tab in Access:
  • Add
  • Check In
  • Check Out
  • Differences
  • Get
  • History
  • Properties
  • Share
  • Undo Check Out
The following screenshot shows the Source Control tab in Access 2007: Source Control tab in Access 2007

Adding Access databases to Surround SCM

When you add a project to Surround SCM from Access, all objects in the project are divided into separate files that can be independently controlled. The files are added to a subrepository created in Surround SCM with the same name as the project file appended with an .scc extension. Access requires a two-level relationship between a project file (.mdb) and a project directory (.scc) because any files in the project directory are recognized as part of the project. If a project file is stored in its own project directory, Access cannot open it. To add an Access database:
  1. Choose Source Control > Add Database to Surround SCM. A message indicating there is no association between the project directory and a repository in Surround SCM opens. Prompt to fix the association between the Access database and   Surround SCM repository
  2. Click Fix to create a repository and associate the database with it. The Create Repository dialog box opens.The 'New repository' name and 'Working directory' field are automatically populated. To ensure the integration works properly, we recommend that you do not change these options. Create Repository dialog box

Creating Access databases from Surround SCM

When you create a database from a project already stored in Surround SCM, you must select the repository with the .scc extension for the project you want to open. If the database is under source control, the project is retrieved and used to create a new single project file in the parent directory of the local .scc project directory.

Working directory restrictions

Access requires the local project directory used as the working directory to have the same name as the project repository in Surround SCM including the .scc extension.  When databases are added to Surround SCM, the project repository is automatically created with the correct naming format and should not be modified.

Caveats

The Microsoft Office plug-in uses the MSSCCI API for source code control integration. To avoid potential data corruption, Access project files under source control should not be modified outside of Access if the project is in use by other users.

Troubleshooting

If you encounter problems viewing the check out status of Access files stored in Surround SCM, reset your working directory.
  1. Delete the .scc folder, the .mdb file, and the .MySCMServerInfo file from your local Access project directory.
  2. In Surround SCM, choose Tools > Working Directories and delete the working directory you set for the Access project.
  3. In Access, choose Create from Surround SCM. You are prompted to set a working directory. Select a path that ends with the exact Surround SCM repository name including the .scc extension.