Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Mark Olbert
 
Posts: n/a
Default Sql Query: 255 character Limit

Situation:

Office Apps: Excel XP and Word XP

My .NET Windows.Forms app creates an Excel file using OLE Automation and populates that file with
data from a database. I then use MailMerge.OpenDataSource() to open the Excel file with the
following connection string and Sql command:

string connStg = "Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";Us er ID=Admin;Data Source=insert
file user-selected Excel data file with full path here;Mode=Read;Extended
Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet
OLEDBat";

string sqlStg = "SELECT * FROM `Sheet1$`";

These are based to OpenDataSource() as ref'd objects.

Problem:

There are actually two mailmerge operations I'm testing. The first succeeds, the second fails with
the infamous "255 character limit" exception. The length of connStg + sqlStg is 277 characters for
the first, successful merge and 290 characters for the second, failing merge. I'm not sure if those
character lengths are what Word is "seeing" on its end, as .NET uses Unicode and I'm not sure what
Word uses internally.

Any suggestions on how to resolve this situation?

- Mark

p.s. BTW, may I assume that whatever, ahem, person left a 255 character limit in the Word mailmerge
subsystem at least through Office XP has been summarily fired?


 
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
Save file as .doc having all data in ascii character set Freddy Microsoft Word Help 1 February 3rd 05 09:44 AM
Can't Open Data Source (Query) where criteria is defined by functi l_stocky Mailmerge 5 January 21st 05 03:01 PM
Character limit in mail merge Carson Mailmerge 1 January 6th 05 05:17 PM
255 character limit in Word mail merge Gibson Mailmerge 1 December 7th 04 10:36 AM
character spacing changed when document prints cindy Microsoft Word Help 1 December 6th 04 10:18 PM


All times are GMT +1. The time now is 01:57 PM.

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"