Record 1 contained too few data fields

H

HJ

I have set up a User DSN called PCI that uses the Microsoft Access Driver
and connects to a user database (.mdb) and a custom system database (.mdw).



I have used Microsoft Word to create a new .odc file (with +Connect to New
Data Source) to connect to a query called qryWord and this connection works
well.



Then I have set up a mail merge document that uses this .odc file. The data
link properties are set correctly and when I test the connection the result
is OK: "Test connection succeeded."



But when I close the Data Link Properties dialog box error messages are
being displayed: "Record 1 contained too few data fields." and "Record 2
contained too few data fields.".



In my test database the query qryWord returns three (3) records. That leads
me to the conclusion that the first record is considered a header row. And
since some fields in the first record are empty, there is a mismatch of the
number of header 'names' and the number of fields per record.



As a test I have exported the query results to a comma separated file (.csv)
with the use of a first row with field names; that file was merged with
correctly. If I do not include the first row with field names, the file is
not merged correctly.



Therefor I am looking for a solution to have the first row in my query not
be considered a header row by the .odc connection or by the User DSN (I do
not know which one is responsible for this). How do I do that?



Thanks in advance,



HJ
 
C

Cindy M -WordMVP-

Hi Hj,
I have set up a User DSN called PCI that uses the Microsoft Access Driver
and connects to a user database (.mdb) and a custom system database (.mdw).

I have used Microsoft Word to create a new .odc file (with +Connect to New
Data Source) to connect to a query called qryWord and this connection works
well.
Why not just connect directly using ODBC, and leave the (faulty) OLE DB part
out of this? Activate "Confirm conversions on open" in Tools/Options/General.
Now you can select ODBC as the connection method. In order to see your query
in the list, click "Options" and activate "Views".

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 :)
 

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