VB.Net app reading contacts from SQL Server db into Outlook 2000 returns difficult-to-identify COM error
Posted on 2004-11-23
I have a VB.Net app which runs stored procs against an SQL Server db to write the contacts of the logged in user to their Outlook contacts folder. It all works fine except sometimes I get this error:
System.Runtime.InteropServices.COMException(OxAF6040005 although the specific number here varies): The operation failed
at Outlook._ContactItem.Close(OlInspectorClose SaveMode)
Some debugging I've done also gives me this information: Error Code: -936361979 (again this differs each time)
Message: The operation failed.
Source: Microsoft Outlook
The result is that some but not all of the person's contacts are written to Outlook, and the record on which it stops differs every time (so sometimes it will fail after 4 records, sometimes after 272 - no consistency so it's not as though there's a problem with a particular record, also it happens to <1 user, only common theme is that of 4 users tested it happens to those with >100 contacts but not to those with <100 contacts).
I can't find any really useful info on this on the web and I'm keen to get it sorted hence high number of points.
Thanks in advance,