Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a third party application with a SQL Server (2008 R2) back-end that allows the user to select person records and use this selection to as a data source for a MS Word mail merge. This process worked fine until we upgraded the desktop OS from windows XP Pro to Windows 7. Now, the mail merge works sometimes. Other times, the user will get the error

Object reference not set to an instance of an object.

This error does not happen if the application is "Run as Administrator". However, allowing everyone to run this application as an administrator is not a viable solution. We have spoken with the developers of the application and they are not experiencing this problem despite a similar set up.

Another point of note. The templates for the mail merge are stored on a network share. However, the results are the same if the templates are located on the user's local machine.

Any suggestions as to why we may be getting the above error would be greatly appreciated.

Cheers, Joe

share|improve this question
add comment

1 Answer

Have you double checked the data returned from the DB when you query for the person outside of the 3rd party app? Will merging a specific person in the 3rd party app always return the error? Can you also successfully merge another person's data repeatedly without error?

That "Object reference not set to an instance of an object." is usually a very general way of giving a null exception, meaning perhaps one of the required mail merge fields is not being populated by the 3rd party software's SQL query. Is there any other logging provided by the app that might hint at which part threw the error?

Mail merge can have its own set of limitations depending on how the developers have designed their app. If the data returned from the query has any special delimiting characters in it (common ones are commas, tabs, or semicolons), the results may be parsed improperly and mail merge may fail for example.

The only reason I could think that this would be a permissions issue solved by running as an Admin would be because the user does not have read access to the mail merge template or write access to the output directory. If the app is server+client based and uses COM+ that could also cause permissions problems, but it should not be intermittent as you described.

share|improve this answer
    
To answer your questions: I have checked the data coming from the DB and there are no issues with it. The thing is that the mail merge process will sometimes work and sometimes fail. The failure or success of the merge seems to be independent of the data records selected for the merge. In other words, the mail merge will succeed for a group of records but if the merge is run again for the same group it may fail. Sometimes the merge will succeed for the same group of records several times before a failure occurs. –  Joe Bloggs Feb 15 '11 at 18:26
    
Unfortunately, there is no additional logic provided by the developers of the 3rd party app that would provide more information as to what is causing the error. Also, I don't believe there is an permissions issue with reading or writing as the merge is sometimes successful. –  Joe Bloggs Feb 15 '11 at 18:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.