473,385 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Text fields from ODBC data source do not merge in Word 2000

Hello,

Thank you in advance for any assistance.

I am trying to set up a mail merge from VB6/VBA code with Word 2000 using an ODBC data source (SQL 2000). I have successfully gotten the connection working using both a file dsn and a machine dsn. I am currently using a simple test merge template with fields <<FirstName>> (a nvarchar) <<Id>> (an int primary key).....plus a <<NextRecord>> field. The template doc itself has no data source attached. The code sets the data source upon calling the OpenDataSource method.

Here's the problem, when the document gets merged, the Id field merges correctly, however the FirstName does not. It just merges as a null string. I've jumped through all sorts of hoops to figure out what the problem is and here is what I've found:
-The same merge code performs correctly in Word 2007. Both the FirstName and the Id fields appear correctly in the merged document.
-Really weird: I am able to reproduce the problem in Word 2007 by leaving out the password in the DSN and being made to manually enter it at merge time. If I do that, I get a null string for the FirstName field.
-Adjusting the Format parameter of the OpenDataSource method makes no difference.
-I can view the result set correctly using the same DSN in MS Query, but upon merging into Word 2000, I still get the FirstName appearing as a null string.
-Any integer field type will merge correctly into Word 2000. Any nvarchar field type will merge as a null string.

Any ideas on how to get this merge working correctly?

Thanks again.
Aug 19 '07 #1
2 2139
MMcCarthy
14,534 Expert Mod 8TB
Have you tried changing the field to a plain varchar?
Aug 28 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
Have you tried changing the field to a plain varchar?
One other thing you could try since you are using VBA is to pass the value first to a variant type variable and then into the merge.
Aug 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: matt tagliaferri | last post by:
We have remote users running MSDE entering information into a database. To send the data back to the home office, we've written some routines that export the data into SQL Scripts in text files: ...
3
by: Lauren Quantrell | last post by:
Maybe a dumb question - I'm new to ODBC. How do I install an Access ..mde file on a user's workstation and create the ODBC connection to the backend SQL Server database without having to go through...
5
by: Alec | last post by:
Hi All, I am currently trying to link in Access 97 to a table in a MSSQL 7 server. Initially the link is fine, however, when I close the access database and re-open it from the same network...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
1
by: svdh | last post by:
I have posed a question last saturday and have advanced alot in the meantime. But I am still not there Problem is that I try to merging various fields from various tables in one document in Word...
11
by: MLH | last post by:
If I run MsgBox "Wow!" and I see text in the title bar - where is that text string setting coming from? Do I have access to change it?
3
by: vtashore | last post by:
I downloaded Steve Leban's RTF2 control and it works as advertised. Good news! After reading reference material on the RTF standard codes, I have been able to write update queries to universally...
1
by: mr k | last post by:
Hi, I wanted to use mail merge with forms but Text form fields are not retained during mail merge in Word, I got the code from Microsoft but it doesn't remember the text form field options such as...
2
by: Roger | last post by:
I've got two tables in sql2005 which have an 'ntext' field when I linked the first table in access97 last week using an odbc data source the access-field type was 'memo' when I link the 2nd...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.