Reply
 
Thread Tools Display Modes
  #1   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

Hi Alessio

Ah, OK, your connection is using OLE DB. Usually, when you see the
message you report, with an OLE DB connection, it usually one of the
other arguments is missing, such as an SQLStatement or a TableName. Why
this would be happening in some instances, and not others, is difficult
to determine without knowing more about how the documents were created,
and what criteria decide which parameters + values are being passed to
the OpenDatasource method.

Given that you can resolve the problem by copying/pasting to a new Excel
Workbook, I'd be inclined to guess that there may be some file damage in
the workbooks you're being sent that's preventing the OLE DB connection
from "seeing" the worksheet.

In your situation, I'd probably

1. test what happens if you try to manually make the connection, in the
Word UI

2. If it works, record that in a macro and compare the code

3. If it doesn't work, see if connecting using ODBC works. If it does,
record that in a macro and adjust your code to use an ODBC connection
method instead of OLE DB. In my experience ODBC is the most reliable,
across all Office versions, with an Access or Excel data source.

thank you for your answer. I take it you mean that my code (which is a
C++ application working with Word2003) should use explicitly DDE.
Actually, the application currently works with the following Connection
string (the 12th argument passed to the OpenDataSource method):

"Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" +
sDataSourcePath + ";Mode=Read;Extended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:Engine Type=35"

while, if I understand what you said, I should replace the use of Jet
OLEDB with the use of DDE. Is it correct?
But I have two questions:
1) why does the current application works with most of the mailmerge
documents submitted to it?
2) why doesn't it work with only some othe documents?


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Select specific cells in table via macro Bill Sturdevant Microsoft Word Help 1 July 27th 05 03:01 PM
Table AutoFormats vs. Table Styles confusion Tony Jollans Tables 5 March 6th 05 07:18 PM
Select Table dialog box comes up twice when open data source Paula Jern Mailmerge 0 January 6th 05 05:07 PM
Select Table dialog box after choosing data source Paula Jern Mailmerge 1 December 4th 04 04:28 PM
Select Table dialog box after choosing data source Paula Jern Mailmerge 2 December 2nd 04 03:13 PM


All times are GMT +1. The time now is 08:31 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"