had too few data f, Excel, Word, Access, Powerpoint, Office, Publisher, Visio, Outlook" /> had too few data f Mailmerge" /> Error Message when using ODBC: " Record <n> had too few data f - OfficeFrustration
A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Error Message when using ODBC: " Record had too few data f



 
 
Thread Tools Display Modes
  #1  
Old April 19th, 2005, 04:04 PM
Pat
external usenet poster
 
Posts: n/a
Default Error Message when using ODBC: " Record had too few data f

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!




  #2  
Old April 19th, 2005, 05:46 PM
Peter Jamieson
external usenet poster
 
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!






  #3  
Old April 22nd, 2005, 08:34 PM
Mike
external usenet poster
 
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.



  #4  
Old April 22nd, 2005, 09:04 PM
Peter Jamieson
external usenet poster
 
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.





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
strategy for data entry in multiple tables LAF Using Forms 18 April 25th, 2005 04:04 AM
ODBC Wade General Discussion 1 February 13th, 2005 07:46 AM
printing label for record that has focus on the form babs Setting Up & Running Reports 0 February 4th, 2005 06:01 PM
Need Help Automating linking of ODBC tables with Unique Record Ide Steven General Discussion 0 November 12th, 2004 02:27 AM
dealing with a subform record when it's "dirty" Paul James Using Forms 8 October 17th, 2004 08:45 AM


All times are GMT +1. The time now is 09:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.