Reply
 
Thread Tools Display Modes
  #1   Report Post  
Phill
 
Posts: n/a
Default OpenDataSource problem

I have and Access 2003 (saved as Access 2000 format) database using Word 2003
to do a simple mail merge. I get a message that says it couldn't open the
document. When I try to manually do the merge, and test the connection, I
get a message saying "test connection failed because of an error in
initializing provider. The database has been placed in a state by user
'Admin' ...that prevents it from being opened." When I close my database
and
test the connection it works. I've tried this several times with the same
results. Any ideas? Thanks. Phill

Here is my code.

Set WordDoc = GetObject(strFinalDoc, "Word.Document")
WordDoc.Application.Visible = True

WordDoc.MailMerge.OpenDataSource _
Name:=CurrentDb.Name, _
LinkToSource:=True, _
ReadOnly:=True, _
Connection:="TABLE tempMailMerge", _
SQLStatement:="SELECT * FROM tempMailMerge"

WordDoc.MailMerge.Execute





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

I would guess the problem is as follows:
a. you already have the data base open
b. the Connection string is the string that you would have used in Word
2000 or earlier to open the database using DDE
c. however, the OpenDataSource code you are using will cause Word to try to
open the database using OLEDB, not DDE. OLEDB will not recognise this
connection string, either.
d. OLEDB probably tries to open the database in a sharing mode that is
incompatible with the mode it is already open in, and will fail.

Possible solutions:
e. modify the connection string to specify a mode that will work (not sure
this can actually work)
f. add the parameter

SubType:=wdMergeSubTypeWord2000

to your OpenDataSource call. This shouls make Word open the database using
DDE.

NB, you probably do not need either of these lines:

LinkToSource:=True, _
ReadOnly:=True, _


Peter Jamieson

"Phill" wrote in message
...
I have and Access 2003 (saved as Access 2000 format) database using Word
2003
to do a simple mail merge. I get a message that says it couldn't open the
document. When I try to manually do the merge, and test the connection, I
get a message saying "test connection failed because of an error in
initializing provider. The database has been placed in a state by user
'Admin' ...that prevents it from being opened." When I close my database
and
test the connection it works. I've tried this several times with the same
results. Any ideas? Thanks. Phill

Here is my code.

Set WordDoc = GetObject(strFinalDoc, "Word.Document")
WordDoc.Application.Visible = True

WordDoc.MailMerge.OpenDataSource _
Name:=CurrentDb.Name, _
LinkToSource:=True, _
ReadOnly:=True, _
Connection:="TABLE tempMailMerge", _
SQLStatement:="SELECT * FROM tempMailMerge"

WordDoc.MailMerge.Execute







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
Word Problem w/Auto Text and Spell Check and Crashing HW Microsoft Word Help 1 January 12th 05 04:59 AM
Word 03 Envelope Print Problem DeanLeaf New Users 1 January 3rd 05 06:52 PM
Problem formatting Wordpad (and often Word) Chad Harris New Users 1 December 27th 04 10:03 PM
Word User Network Problem Alpine Tom Microsoft Word Help 1 December 17th 04 04:51 PM
Font Problem in Outlook with Word as E-mail Editor Linny Microsoft Word Help 0 December 13th 04 03:21 PM


All times are GMT +1. The time now is 02:44 PM.

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"