Business Contact Manager and Outlook 2007

My group at work has decided to use Business Contact Manager (BCM) for tracking engagements we're doing with other product groups here at Microsoft. My team is a sort of internal consulting organization focused on software development processes and tools at Microsoft.

So I went to setup BCM on my machine to play around with it.  It's been a bit of a twisty path, so I thought I'd document some of what I learned in case others run into this.  Interestingly, most of the rest of my team was able to set up without encountering this, so it's probably something weird on my machine that is causing these problems.  But it's a big world out there, so there probably are other machines that will run into some of these issues.

I'll also describe how I troubleshot some of these issues and eventually ended up with everything running.

1. Problem 1 - during install of BCM, I got the error "Setup failed to install the required component Microsoft SQL Server 2005 Express (MSSMLBIZ)".  This turned out to be that SQL Server 2005 Express was already installed on my machine (as part of Visual Studio 2008 - I suspect a number of my problems were the result of having installed VS 2008 previously) and a separate install of an unrelated product had been done with a pending reboot needed.  I had not rebooted the machine in several days and had forgotten that I had installed whatever the other thing was. When BCM comes along and sees that SQLServer 2005 Express is already installed, it invokes the SQL Server installer to set up the new instance for MSSMLBIZ - but SQL Server install refused to run because there was a pending reboot. Rebooting the computer fixed this one.  I found this by running SQL Server 2005 Express install myself (from add/remove programs in control panel) intending to remove SQL Server 2005 Express and let BCM reinstall it.  It turns out that would have worked - because I would have rebooted after doing this - but in fact was not necessary.  When I ran the SQL Server 2005 Express install from add/remove, it told me it couldn't run because of the pending reboot action - and a lightbulb went off.  I realized this was probably why BCM install couldn't run the SQLServer install either.  So I rebooted and this one was resolved.

 2. Next problem was the Office 2007 Primary Interop Assemblies (PIAs).  These are some glue between Office and .NET applications.  They also had previously been installed as part of VS 2008, so again, this shouldn't have been a problem for BCM - it should have gone to install them, seen that they were already there, and just moved on.  But there is a problem with the name of the installer file that BCM uses for these PIAs and the name that VS 2008 uses - this is described in more detail at https://jlchereau.blogspot.com/2008_04_01_archive.html.  The net effect is that BCM is trying to access O2007PIA.MSI on its installation media for these PIAs, but in fact the file that BCM ships for these is PIARedist.MSI.  If I uninstalled the PIAs and reran BCM setup, I'm sure it would work (which is probably why it works for most people), but I didn't want to do that.  Instead, I copied the entire installation tree from BCM locally to my %TEMP% directory (I was installing from a network share, but you could also do this from the CD if you're installing from CD) and then in the "OFFICE" subdirectory, I just copied the PIARedist.MSI file and made a copy named O2007PIA.MSI.  Now both files were on the installation media, and when BCM install went looking to install the PIAs that were already installed and the installer said, OK, they must have been installed from a file called O2007PIA.MSI - that file was there.  Problem resolved.

3. The next problem was a configuration error on our side - the shared BCM database on our server wasn't set up for all the users to access it.  I didn't fix that, but the guy on my team who set up the SQL Server database added our accounts to the SQL Server permissions and that solved that problem.

4. The final problem was a local database creation problem.  BCM uses SQL Server 2005 Express edition to keep a local copy of the database.  That way, if you're not able to connect to the server (e.g. you're at home, or on the road) it can still reference and make changes in the database cached locally.  Then it syncs these changes when you reconnect.  The error I received when I ran the BCM Wizard on starting Outlook after installing BCM was "Database creation was unsuccessful."  I figured this was likely a permissions error (since I know SQL Server is running fine - I confirmed that the MSSMLBIZ instance is running by going to Start / Computer, right clicking and selecting "Manage...".  From there, I looked at Services and Applications / SQL Server Configuration Manager and I see the SQL Server (MSSMLBIZ) showing as running.  I note that it is running under the account "NT AUTHORITY\NetworkService".  I went back into Outlook and tried again to to create the offline database (by clicking "OK" in the "Configure database for offline use" wizard screen) and confimed the error still occured.  I then went to start / Run and ran "EventVwr" and navigated to the Windows Logs / Application log file.  I noticed two recent errors from MSSQL$MSSMLBIZ which is my instance of local SQL Server 2005 Express running.  The error was: "CREATE FILE encountered operating system error 5(Access is denied.) while attemptin to open or create the physical file "C:\users\mike\AppData\Local\Microsoft\Business Contact Manager\MSSmallBusinessOutlook_offline.mdf'."  So that tells me that SQL Server is having permission problems with the directory C:\users\mike\AppData\Local\Microsoft\Business Contact Manager.  This is probably because it's running under NetworkService and that account doesn't have write permission in this directory.  I went back to the Start taskbar, selected Run and pasted in "C:\users\mike\AppData\Local\Microsoft" to open the containing folder.  I right clicked on the "Business Contact Manager" subfolder in this folder and clicked on Properties, then went to the Security tab.  Sure enough, no entries for NetworkService - so it will just inherit permissions based on the group hierarchy.  I'm pretty sure NetworkService isn't SYSTEM, and I doubt it's me (which is the next permission list) so it's probably getting either the Everyone or MIKE\Users permissions.  I clicked on "Users" and cliked Edit, added "Modify" permission for this group (full disclosure: I have now given every user on my machine write permission into an area of my local profile, but since it's just the BCM folder I'm not too concerned) and OKed out of these.  Went back to Outlook, clicked Next in the wizard - and voila, the database is created.