Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2007

Tip: Looking for answers? Try searching our database.

MailMerge API Trouble

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bpmhanson@aol.com - 12 Feb 2007 19:10 GMT
Hello All,

I have a question about MailMerge from within an api call.  I have
word doc set up using the mailmerge wizard that creates an SQL
Server .odc file to use as a datasource.  I am calling the
OpenDataSource method (o1.ActiveDocument.MailMerge.OpenDataSource(...)
via a PowerBuilder app. All is well.  However, I have one client that
is getting DB errors when trying to run.

The .odc connection is pointing to a view that has public
permissions.  Looking at the SQL trace, there is an exec sp_cursoropen
line containing a select statement from the view.  Followed by an exec
sp_cursorfetch.  Followed by an exec sp_cursorclose.  Then a couple of
BatchCompleted lines.  All is well.

Then these several lines repeat (within the trace) and I get an error
after the second exec sp_cursorclose 180150000.  The errors are Error:
208, Severity: 16, State: 1 followed by Error: 16945, Severity: 16,
State: 1.

Digging through posts on these errors, I see that 208 is roughly 'file
not found' and 16945 is trouble with the cursor.

Why might the first time through these statements be OK and the second
time produce errors?  I am running SQL Server 2000 sp4, my client is
running 2000 sp3.  I am on Word 2003 sp2, the client is on word 2002
sp3.

I cannot recreate these errors in my environment, but the client has
sent me his traces and I see where (but not why) the error is
occuring.

Any ideas?

Thanks in advance,
Brian
Peter Jamieson - 12 Feb 2007 23:38 GMT
Looks like a tricky one...

Does your client have Excel, and if so, can they try using the same .odc as
a data source from Excel? (And can they connect manually from Word 2002?

Are any of the other clients with no connectivity problems also using Word
2002, or are they all Word 2003 users?

Peter Jamieson

> Hello All,
>
[quoted text clipped - 32 lines]
> Thanks in advance,
> Brian
Peter Jamieson - 13 Feb 2007 08:20 GMT
(Or if you can double-click on the .odc and see records displayed as a
result, it may be possible to do this test without Excel)

> Looks like a tricky one...
>
[quoted text clipped - 43 lines]
>> Thanks in advance,
>> Brian
bpmhanson@aol.com - 13 Feb 2007 18:53 GMT
On Feb 13, 3:20 am, "Peter Jamieson" <p...@KillmapSpjjnet.demon.co.uk>
wrote:
> (Or if you can double-click on the .odc and see records displayed as a
> result, it may be possible to do this test without Excel)
[quoted text clipped - 50 lines]
>
> - Show quoted text -

Peter,

Thanks for your responses.

I have not tried the Excel approach, however the .odc and running the
merge directly from Word both produce results.  Unfortunately, info on
other clients that may be running Word 2002 is not readily available.

I was able to get the client DB and exact software build, with the
only difference being me using Word 2003 and it worked fine.  That
leads me to the api.  So, we pushed back to the client to upgrade
Word.  We'll see how they respond and if that infact will fix the
problem.

Thank you for your efforts, and you're right, it is a tricky one.

-Brian
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.