Rename Header for tables generated using Database field

D

dorothy

I am using Database field to generate a table from a delimited file.
However, I want to table headers to be renamed dynamically. I was expecting
this can be done by renaming column names in SQL statement, e.g.

SELECT COL1 [NEW_COL1] FROM C:\\Test.txt

However, it gave me an err message of "Word was unable to open the data
source".


I am using Word 2003 and using the default connect info.
Can anyone help?
Thanks,
 
P

Peter Jamieson

1. For this to work, you have to be using a dialect of SQL that lets you
"alias" the field names. However, in this case I think the DATABASE
field will use Word's internal text converter, which uses a very simple
dialect of SQL that does not support that.

2. However, even changing your DATABASE field so that it will get the
data via OLE DB (and therefore use the Jet/ACE SQL dialect) does not
seem to let you use alias names for the fields - at least, not n Word
2007. It could be that I have not used the correct syntax but I am using
exactly the same statement as I can successfully use in Access.


Peter Jamieson

http://tips.pjmsn.me.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top