Thanks Peter but I have tried surrounding the text with single quotes. I
have
not tried double quotes but since that would lead to an odd number of
double
quotes I would be surprised if it worked.
I tried it before I posted my response and it works here. However, you do
have to /double up/ any double quotes in your data as well, which you may
not have done before.
Obviously I cannot guarantee that it works there for the reasons I have
given, among others. Doubling up "quoted" characters has always been one of
the standard ways to deal with tthis kind of situation as you can see, for
example, if you write a bit of VBA to assign text to a string variable then
mystring = "here is some text with a double quote "" inside it"
it will work.
So why not give it a try?
I have tried prefixing the " with a \ (remember seeing that somewhere) and
I
Yes, among other things there's a curious option in the Compatibility
options within Word to do with \", but I've never got it to do anything
useful.
I will check with the person who wrote the process that fires off and
prints
the document if he is using ODBC but if he is am I screwed or is there a
way
to tell ODBC that the field is valid?
The problem is not so much whether the programmer has chosen to use ODBC. In
some situations Word chooses for you and it's not necessarily
straightforward to choose /not/ to use ODBC.
However, if you have full control over the format of the file you are
creating and can have the Word document changed as well, then there are
other things you can try if none of the above work. I can't say "this or
that particular approach will definitely work whatever you are using, but
a. if you can write any "plain text" type output you could try
- writing an HTML format file containing a table with one cell per
datum. This will probably work for up to around 63 data columns. it doesn't
need to be "standard" HTML with all the right headers for Word to
understand it, e.g. if you have two columns "key" and "text" you can use
<HTML>
<BODY>
<TABLE>
<TR>
<TD>Key</TD>
<TD>Text</TD>
</TR>
<TR>
<TD>1</TD>
<TD>text with " quotes</TD>
</TR>
</TABLE>
</BODY>
</HTML>
You don't get the multiline stuff.
In fact I think you can get away without the <HTML><HEAD> and if you lay out
the text rather differently
<TABLE>
<TR><TD>Key</TD><TD>Text</TD></TR>
<TR><TD>1</TD><TD>text with " quotes</TD></TR>
</TABLE>
you can see that it is structurally similar to a delimited text file, but
with a slightly more complex system of delimiters.
- writing an RTF file with tab delimiters. I can give you more info on what
that needs to look like if you want.
b. If you are able to use Windows API calls - I notice that automating
Excel, or presumably Word, is a step to far for you - you could consider
using ADO to create a .mdb (Jet) file directly. But I guess that depends
primarily on where the processing is happening and so on.
I don't suppose it can be done using a view in your DBMS and a suitable
ODBC/OLEDB connection at the Workstation end?
Peter Jamieson