had too few data field, forum, newsgroup, Microsoft Word, help, support, Microsoft Office" /> had too few data field Mailmerge" /> Error Message when using ODBC: " Record <n> had too few data field - Microsoft Office Word Forum - WordBanter

Reply
 
Thread Tools Display Modes
  #1   Report Post  
Patrice
 
Posts: n/a
Default Error Message when using ODBC: " Record had too few data field

I am trying to connect to an Oracle database thru Word. The connection
wizard allows me to sign onto the database and pick which table I need.
However, after I choose 'open source', the above error message is received
and nothing from the table is displayed. Any help or guidance would be
greatly appreciated.

Thanks!
  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

Which version of Word?

Whose ODBC driver are you using? Oracle's, or Microsoft's?

Did you already have an ODBC DSN defined for Oracle? If so, which type
(User/System/File) ?

Did you see any options that asked whether security information
(login/password) should be saved? If so, you probably need to select those
options.

Peter Jamieson

"Patrice" wrote in message
...
I am trying to connect to an Oracle database thru Word. The connection
wizard allows me to sign onto the database and pick which table I need.
However, after I choose 'open source', the above error message is received
and nothing from the table is displayed. Any help or guidance would be
greatly appreciated.

Thanks!



  #3   Report Post  
Pat
 
Posts: n/a
Default

Hi, thanks for responding. 1. the version is Word 2002 on XP. 2. using
Microsoft's Oracle Driver....when the data connection wizard appears, I
choose 'Oracle'. 3. system 4. Yes, I see a checkbox that saves 'allow
saving password'. when checked I get the same error.

Thanks in advance for any suggestions.
Pat

"Peter Jamieson" wrote:

Which version of Word?

Whose ODBC driver are you using? Oracle's, or Microsoft's?

Did you already have an ODBC DSN defined for Oracle? If so, which type
(User/System/File) ?

Did you see any options that asked whether security information
(login/password) should be saved? If so, you probably need to select those
options.

Peter Jamieson

"Patrice" wrote in message
...
I am trying to connect to an Oracle database thru Word. The connection
wizard allows me to sign onto the database and pick which table I need.
However, after I choose 'open source', the above error message is received
and nothing from the table is displayed. Any help or guidance would be
greatly appreciated.

Thanks!




  #4   Report Post  
Peter Jamieson
 
Posts: n/a
Default

From what you describe, I'd guess you are probably actually using the OLEDB
provider, not the ODBC driver. Are you asked to save a .odc file at some
point? If so, it's OLEDB.

Unfortunately I no longer have an Oracle set-up to experiment with here and
the following is rather complicated, but this is what I would probably do:
a. if my connection used a .odc file, open the .odc file using Notepad and
look at the connection string. (Note that it is in an "HTML" format). Does
it contain your login information? If it does not, try editing the file to
include the login information and try again. If it does, then this approach
is probably not going to work. You can try to open the data source using a
VBA OpenDataSource statement instead. In that case, I would
- copy the connection string and de-HTML it. The resulting string needs to
have a maximu length of 255 characters. If you need to shorten it, there
are usually plenty of parameters you do not need to set
- use Notepad to create a completely empty .odc file, e.g. called
blank.odc. Let's suppose its pathname is c:\myodcs\blank.odc
- create a Word VBA macro that calls OpenDataSource, e.g.

Sub OpenOracle()
ActiveDocument.MailMerge.OpenDataSource _
Name:="c:\mydocs\blank.odc", _
Connection:="the connection string you took from the .odc", _
SQLStatement:="SELECT * FROM tablename"
End Sub

You need to modify the SQL to suit your application.

Make you mail merge main document your active document, run the macro, and
see what happens.

b. If my guess is wrong and you are using ODBC, did you try OLEDB?
c. If you cannot make OLEDB work or were trying to use ODBC anyway, I
suspect that you will need to use VBA anyway, because login security info.
is not normally retained when you create ODBC connections however you do it.
To use ODBC, you will need an ODBC DSN for your Oracle connection - in
recent versions of Windows you can create one in Control
Panel|Administrative Tools||ODBC Administrator. Normally you need a User or
System DSN, but it can be useful to create a File DSN because you can open
the resulting DSN in Notepad and use the contents to help you create a
connection string for Word.

Once you have created your User/System DSN, there are two ways you can try
to connect:
- go through the Select Data Source dialog, and go via MS Query (it's in
the Tools menu at the top right of the dialog). Follow the steps in there.
Before you return the data to Word, I suggest you save the query as a .dqy
file as that can also be opened in Notepad and give you information about
what should be in the connection string. My guess is that if this works, you
will see the data when it is first returned, but after that you will see
errors because the login security information has been discarded.
- use VBA. In this case you will need to construct your own connection
string. The first part needs be
DSN=dsnname;
where "dsnname" is the name of the user/system DSN
the rest can be constructed either using the info. in the .dqy or in the
..dsn file. Each parameter needs to be followed by a semicolon.

Then try

Sub OpenOracle()
ActiveDocument.MailMerge.OpenDataSource _
Name:="", _
Connection:="DSN=dsnname;the rest of the connection string you
constructed", _
SQLStatement:="SELECT * FROM tablename", _
Subtype:=wdMergeSubtypeWord2000
End Sub

I hope at least one of those approaches gets you somewhere. If not, another
thing you can try if you happen to have Access is to use Access to link to
your Oracle table/.view, and use the resulting Access table as your
datasource.

Peter Jamieson

"Pat" wrote in message
...
Hi, thanks for responding. 1. the version is Word 2002 on XP. 2. using
Microsoft's Oracle Driver....when the data connection wizard appears, I
choose 'Oracle'. 3. system 4. Yes, I see a checkbox that saves 'allow
saving password'. when checked I get the same error.

Thanks in advance for any suggestions.
Pat

"Peter Jamieson" wrote:

Which version of Word?

Whose ODBC driver are you using? Oracle's, or Microsoft's?

Did you already have an ODBC DSN defined for Oracle? If so, which type
(User/System/File) ?

Did you see any options that asked whether security information
(login/password) should be saved? If so, you probably need to select
those
options.

Peter Jamieson

"Patrice" wrote in message
...
I am trying to connect to an Oracle database thru Word. The connection
wizard allows me to sign onto the database and pick which table I need.
However, after I choose 'open source', the above error message is
received
and nothing from the table is displayed. Any help or guidance would be
greatly appreciated.

Thanks!






  #5   Report Post  
Mike
 
Posts: n/a
Default

I was getting this same error using the Lotus SQL driver to do a mail merge
with Word 2002. I created the ODBC connection and all seemed well, except
it didn't work. Now for the odd part - using the *same* connection I was
able to access the Notes data in Access. So my first test was to create a
link in Access, then link to the Access DB in Word - voila. It's ugly, but
it worked. Seeing your comment about using MS Query (hadn't realized you
could use that in Word that way - thanks!) got me thinking - and, sure
enough, that worked - and is a LOT easier. Seeing how this works I can
imagine a lot of people where I work are going to be happy at being able to
create a mail merge using their Notes address book.

Mike

"Peter Jamieson" wrote in message
...
From what you describe, I'd guess you are probably actually using the

OLEDB
provider, not the ODBC driver. Are you asked to save a .odc file at some
point? If so, it's OLEDB.
.....

Once you have created your User/System DSN, there are two ways you can try
to connect:
- go through the Select Data Source dialog, and go via MS Query (it's in
the Tools menu at the top right of the dialog). Follow the steps in there.
Before you return the data to Word, I suggest you save the query as a .dqy
file as that can also be opened in Notepad and give you information about
what should be in the connection string. My guess is that if this works,

you
will see the data when it is first returned, but after that you will see
errors because the login security information has been discarded.





  #6   Report Post  
Peter Jamieson
 
Posts: n/a
Default

I had a look at Notes SQL and ODBC a couple of years ago but can't remember
how far I got. I was only experimenting really.

What I do know is that Word mailmerge cannot work with a DSN-less
connection. In other words, specifying "DRIVER=" in the connection string -
as you may be able to do in Access - gets you nowhere in Word. You have to
have DSN= or FILEDSN= at the beginning of the connection string. In Word
2002, if you use DSN then the Name parameter in OpenDataSource must be blank
and you have to specify Subtype:=wdMergeSubtypeWord2000

Peter Jamieson

"Mike" wrote in message
...
I was getting this same error using the Lotus SQL driver to do a mail merge
with Word 2002. I created the ODBC connection and all seemed well, except
it didn't work. Now for the odd part - using the *same* connection I was
able to access the Notes data in Access. So my first test was to create a
link in Access, then link to the Access DB in Word - voila. It's ugly,
but
it worked. Seeing your comment about using MS Query (hadn't realized you
could use that in Word that way - thanks!) got me thinking - and, sure
enough, that worked - and is a LOT easier. Seeing how this works I can
imagine a lot of people where I work are going to be happy at being able
to
create a mail merge using their Notes address book.

Mike

"Peter Jamieson" wrote in message
...
From what you describe, I'd guess you are probably actually using the

OLEDB
provider, not the ODBC driver. Are you asked to save a .odc file at some
point? If so, it's OLEDB.
.....

Once you have created your User/System DSN, there are two ways you can
try
to connect:
- go through the Select Data Source dialog, and go via MS Query (it's in
the Tools menu at the top right of the dialog). Follow the steps in
there.
Before you return the data to Word, I suggest you save the query as a
.dqy
file as that can also be opened in Notepad and give you information about
what should be in the connection string. My guess is that if this works,

you
will see the data when it is first returned, but after that you will see
errors because the login security information has been discarded.





Reply
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
Mail Merge - Next Record If Statement HiramPat Mailmerge 5 April 22nd 05 04:03 PM
Header Record Delimiters fails . . . Ward Mailmerge 3 April 6th 05 05:33 PM
Printing 1 Label per Page - "Next Record" Not Working Kim Finleyson Mailmerge 0 February 1st 05 04:43 PM
Mailmerge starts at wrong record Franc v/d Westelaken Mailmerge 1 December 1st 04 10:59 AM
Word XP and ODBC Sources Cindy M -WordMVP- Mailmerge 0 November 30th 04 05:25 PM


All times are GMT +1. The time now is 06:36 AM.

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"