Word mail merge with foxpro

S

susan@soulbury

I have the foxpro ODBC driver version 6.1.8629.1 loaded on my machine with
word version 2003. I am trying to use mail merge to merge with foxpro data
but when opening the data source in the mail merge helper I hit problems.

Firstly the files of type drop down does not give a foxpro option. So I try
and link to a foxpro table using all file types hoping to get a confirm
conversion type. Then word crashes with no error message at all. I have
before now used foxpro coding to control word to perform a mailmerge
defining the DSN name and it works even if foxpro does not appear in the
list. But this fails aswell.

Does anyone know how to define what appears in the files of Type list.

Does anyone have any idea why it may be crashing and I cannot create the
merge.

Thank you in anticipation, I have gone through all of MSDN to no avail and I
am now stuck
 
P

Peter Jamieson

Does anyone know how to define what appears in the files of Type list.

I do not thnk there is any way to change this.

I'm not particularly familiar with FoxPro any more but
Are you trying to open a .dbc? If so, the following may help.

I do not think you will be able to open a .dbc using ODBC by selecting the
..odc in this dialog box. I suspect the problem is that there is too much
source-specific hardcoding in the component that connects to these files.

If you are actually getting data from a .dbf file, you should be able to
select the .dbf directly in the usual way, selecting the appropriate ODBC
driver in the Confirmation dialog.

Otherwise, if you need to However, you can connect programmatically using
OpenDataSource, e.g. using a User/System DSN called vfpdbc, a .dbc at
c:\fp\fp.dbc, fetching data from a table called t, you can use

ActiveDocument.MailMerge.OpenDataSource _
Name:="", _
connection:="DSN=vfpbc;SourceType=DBC;SourceDB=C:\fp\fp.dbc", _
sqlstatement:="SELECT * FROM t"

You do not seem to need the Subtype:=wdMergeSubtypeWord2000 that is usually
needed when Name:=""

As long as you have MS Query on your system, you can connect to the .dbc
using that approach (in the Select Data Source dialog, open the Tools menu
at the top right and use the MS Query option). However, in that case you may
have to create the ODBC DSN so that it points to a specific .dbc, or you
could perhaps create a File DSN for each .dbc and use that.

Finally, if you have the VFP OLEDB provider installed, you could consider
connecting using that. Perhaps the easiest way is to create a .udl file
using the Microsoft Data Link editor - Word 2003 recognises that as a data
source file type so you do not even need to check
Tools|Options|General|Confirm conversion at open. If you leave the database
name blank, you should be prompted for it; If you fill it in, you should be
taken straight to the table selection dialog. You can probably use the .odc
approach instead.

FWIW, this sort of stuff seems to work a lot more smoothly in Word 2003 than
2002, at least in part because of some fixes, but the point is that if you
also need to use Word 2002 you may have more difficulty.
 
S

susan crookshank

I am trying to connect to a dbf fine not the database. I have aslo tried with
the command method you have described but word crashes out as soon as t tries
to connect to the file. Unfortunately with no error messages to give us a
clue what the problem is.

Does anyonw know how to unistall versions of mdac as it seems that may be
where the problem is.
 
P

Peter Jamieson

Have you tried the OLEDB approach I described? Does Word crash no matter
which approach you use? Does it crash even with a newly created test
database/data file?
Does anyonw know how to unistall versions of mdac as it seems that may be
where the problem is.

I don't know - I suspect the best you can do is re-install or install a
later version.
 
S

susan crookshank

Word crashes whatever method tried. It has been solved now but only by
uninstalling word 2003 and installing word 2000. This makes me concerned that
word 2003 has a problem with this odbc as mentioned in another thread.
 
P

Peter Jamieson

Unfortunately with no error messages to give us a
clue what the problem is.

Yes, the only way I know to generate any debug information in this situation
is to switch on ODBC logging in the ODBC administrator. That gives you a log
of all the ODBC calls made, which may be hard to intepret. Probably worth a
look in case something really obvious shows up.

Would it be possible to try connecting to a .dbc? Or does Word crash no
matter what you do?
Does the problem occur even with a newly created test .dbf?

One thing I am unsure of in FoxPro these days is whether dbf have the same
structure regardless of whether they are associated with a .dbc or not -
i.e., if they are associated with a .dbc, maybe you /have/ to go the .dbc
route.
Does anyonw know how to unistall versions of mdac as it seems that may be
where the problem is.

I don't know - you may need to ask in another group - but as far as I know
mdac is supplied as part of more recent versions of Windows so you may not
be able to uninstall it. I suspect the best you will manage is to reinstall
the version you have, or install a later version.
 
S

susan crookshank

The dbf is not attached to a dbc as I have always found that more unreliable.
I have been fighting with ODBC and word for years as I have an application
tht I sell written in foxpro that then controls wrod to produce mail merge
letters. The MDAC 2.5 installaion helpded greatly I am just a bit worried
that now they have taken the foxpr bit out of recent MDAC installaions it
will fall aprat soon again, just do not knwo when.
 
P

Peter Jamieson

Understood. As far as I can tell, most of MS's data access attention is
given to ADO.NET (no use to Word mailmerge users!) and SQL Server these
days, but assuming the OLEDB provider is still supported and you can use it
in your application it could be worth pursuing this problem directly with
MS.

Incidentally, to go back to your original question about the list of file
types, I did come across an article about using FoxPro with earlier Word
versions which claims that you need an Installable ISAM for the extension to
appear in the list of file types. I don't know if that is actually correct,
and it's not relevant since there isn't an IISAM for FoxPro and AFAIK there
is no documentation on how to build your own IISAM even if you wanted to,
but the article is at

http://support.microsoft.com/default.aspx?scid=kb;en-us;277772
 

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