In this case you may find that using both SQLStatement and SQLStatement1
parameters in the OpenDataSource call fixes the problem - just make sure
that the two strings, when concatenated, have valid SQL. I don't think you
can do this by setting the QueryString property.
However, there definitely used to be a problem with Word XP and OLEDB
providers whereby the combined length limit, which should be more like 511
chars, is actually only more like 255. So this may not work either. I only
looked at it briefly a couple of years ago but also suspected the problem
may have had something to do with byte count vs. character count.
The only other things I can suggest are
1. using ODBC insted of OLEDB. Unfortunately, you cannot do a DSN-less
connection so you must have a DSN of some kind on the user machine
2. create the .xls you really need for the merge, if possible - if
necesary, in addition to the .xls you (presumably) need for other purposes
3. you might be better off putting your data in a .mdb, e.g. using ADO and
ADOX, and creating a Query/View in the database using ADO, then using that
as the data source. if you don't need the .xls, that might be enough. If you
do, you could consider
a. creating the .mdb as well
b. creating the .xls, and creating a .mdb with a query that grabs data from
the .xls, and using the query as the data source.
All messy, and I don't know for sure if any of them will work,
Peter Jamieson
> Situation:
>
[quoted text clipped - 36 lines]
> limit in the Word mailmerge
> subsystem at least through Office XP has been summarily fired?
ianc - 31 Jan 2005 19:33 GMT
Not sure if this is appropriate but I had a similar problem and found a
solution on MSDN using DDE -
http://support.microsoft.com/default.aspx?scid=kb;en-us;242072
> In this case you may find that using both SQLStatement and SQLStatement1
> parameters in the OpenDataSource call fixes the problem - just make sure
[quoted text clipped - 64 lines]
> > limit in the Word mailmerge
> > subsystem at least through Office XP has been summarily fired?