Free Support Forum - aspose.com

COM object complications

I installed the component as unmanaged code for com purposes in ASP. I used the sample code supplied in a previous thread. I am getting the following error message:

System.Data error ‘80040e25’

Row handles must all be released before new ones can be obtained.

The error is caused by the call to
Doc.MailMerge.ExecuteADO RS

Let me know if you have any insights
Thanks,
Richard Hall

Hi Richard,

Please post your ASP code here or email to word@aspose.com. We have not encountered this problem before.

Please check if these two KB articles in MSDN apply to your problem:

PRB: Error When You Use adLockBatchOptimistic with OLE DB Provider.

FIX: Error Training Mining Model That Has Many Input Attributes and Many Rows of Data.

They both result in the error message you get.

I am on SP3a and am using a client side recordset. I can call the function now but it is not merging. I am trying to merge into the test document “PersonalizedLetter.doc” from your demo using the FullName token and it is not replacing it. Please let me know if you have any suggestions. Below is the code.

Dim RS
Set RS = CreateObject(“ADODB.Recordset”)
RS.CursorLocation = adUseClient
RS.Open _
“SELECT TOP 50 CompanyName AS [FullName], * FROM Customers ORDER BY Country, CompanyName”, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Aspose\Aspose.Word\Demos\Database\Northwind.mdb"

Dim Word
Set Word = CreateObject(“Aspose.Word.Word”)

Dim Doc
Set Doc = Word.Open(“C:\PersonalizedLetter.doc”)
Response.Write RS.Fields(“FullName”) & “


'Doc.MailMerge.ExecuteADO RS
Doc.MailMerge.ExecuteWithRegionsADO RS, "FullName"
Doc.Save "C:Test.doc"


Thanks
Richard Hall

  1. MailMerge.Execute and MailMerge.ExecuteWithRegions work differently. If you need a simple mail merge such as in the Personalized Letter document you need to use MailMerge.ExecuteADO. You only use MailMerge.ExecuteWithRegions when you have repeatable regions defined in your document.

    2. Even if you use ExecuteWithRegions, your need pass a recordset and a table name (repeatable region), not field name like in your example.