database connection problem with Word 2003 tables

D

Dan

Using Word 2003. Program written in VB 6. Program opens Word document and
sends the Update Fields command. Has worked fine for years. Recently Word has
opened the Connect to Database dialog box. The computer has System DSN
connections to the correct DB and works fine. Why has the dialog box started
opening? Was there an update/patch to Word that forces the dialog box? can I
create a connection string in the Word Field Code that doesn't use the DSN
and connect directly? Any options in Word itself? Any way to eliminate the
dialog box?

Database is MySQL 5.0.41 Community. I have used the ODBC connector version
3.51.08 and 3.51.12 with the same results.
 
P

Peter Jamieson

The main problem with automating Word Mail merge tends to be that you have
to set the registry entry described in

http://support.microsoft.com/kb/825765/en-us

I am not sure why you would suddenly need to look at that possibbility, but
there was an unfortunate "security-related" change to Word a few months ago
that may have a bearing on this.

FWIW if you want an ODBC connection you have to specify a DSN of one kind or
another - Word's OpenDataSource does not seem to accept DSN-less connection
strings that specify the driver name in {Driver name} format. I don't know
if there is currently a viable OLE DB provider for MySQL but even with that,
despite the fact that the connection string can define everything needed to
connect, you still have to specify a suitable external file such as a .odc
file or .udl file in the Name parameter of the OpenDataSource method call.
 
D

Dan

Thanks Peter,

I don't know if that was the problem, but I got it to work correctly again
just before I left work this afternoon. I opened a fresh document, then
inserted a new database field. After I completed the Wizard, I had a
connection string that differed from the old one, and it functioned fine. Who
knows why!

Anyway, it's now working, in fact even better than before, because if it
returns an empty result, there's no longer an alert notice. Even better :)

I will make note of that registry entry. Thanks for the info.
 

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