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  

Unable to open datasource



 
 
Thread Tools Display Modes
  #1  
Old August 10th, 2004, 12:33 PM
Salchow
external usenet poster
 
Posts: n/a
Default Unable to open datasource

When trying to run a mailmerge from Access 2003 I keep getting "Unable to
open datasource" error. This used to work for me in pervious versions of
Office, but now there seems to be some kind of locking mechanism that
prevents Word from accessing the database.

Connection String

stConnect = "DSN=MEFDSN;DBQ=" & stDatabasePath & ";DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;"

..OpenDataSource Name:=stDatabasePath, _
ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=False, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:=stConnect,
SQLStatement _
:="SELECT * FROM `qryMailMerge` WHERE ProsjektID = " +
stProsjektID, SQLStatement1:=""

The strange part is that it seems to work occasionally, but most of the time
it does not.
  #2  
Old August 10th, 2004, 01:08 PM
Peter Jamieson
external usenet poster
 
Posts: n/a
Default Unable to open datasource

If you're using Word 2003, word opens Access databases using OLEDB by
default. Previously, Word would probably have used ODBC, given that you were
providing a DSN in your connection string. The locking assumptions may be
different (I do not know for sure) and although generally speaking you ought
to be able to specify a particular access mode using OLEDB, as far as I can
tell you can't specify the access mode when Word is connecting to a data
source.

WHat you may have to do is try to use ODBC, and in Word 2003 you need to
provide an additional parameter, something like

Subtype:=wdMailMergeSubtypeWord2000

You may need to do more than that but I'd try that first.

--
Peter Jamieson

"Salchow" wrote in message
...
When trying to run a mailmerge from Access 2003 I keep getting "Unable to
open datasource" error. This used to work for me in pervious versions of
Office, but now there seems to be some kind of locking mechanism that
prevents Word from accessing the database.

Connection String

stConnect = "DSN=MEFDSN;DBQ=" & stDatabasePath & ";DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;"

.OpenDataSource Name:=stDatabasePath, _
ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=False, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:=stConnect,
SQLStatement _
:="SELECT * FROM `qryMailMerge` WHERE ProsjektID = " +
stProsjektID, SQLStatement1:=""

The strange part is that it seems to work occasionally, but most of the

time
it does not.



  #3  
Old August 31st, 2004, 07:43 PM
Ravi
external usenet poster
 
Posts: n/a
Default

Where do you go to edit the datasource? Can you please
tell me step-by step where to go so I can edit this line
in:
Subtype:=wdMailMergeSubtypeWord2000
to make it DDE instead of OLEDB.

Thanks.

-----Original Message-----
When trying to run a mailmerge from Access 2003 I keep

getting "Unable to
open datasource" error. This used to work for me in

pervious versions of
Office, but now there seems to be some kind of locking

mechanism that
prevents Word from accessing the database.

Connection String

stConnect = "DSN=MEFDSN;DBQ=" & stDatabasePath

& ";DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;"

..OpenDataSource Name:=stDatabasePath, _
ConfirmConversions:=False,

ReadOnly:=False,
LinkToSource:=False, _
AddToRecentFiles:=False,

PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="",

WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto,

Connection:=stConnect,
SQLStatement _
:="SELECT * FROM `qryMailMerge` WHERE

ProsjektID = " +
stProsjektID, SQLStatement1:=""

The strange part is that it seems to work occasionally,

but most of the time
it does not.
.

  #4  
Old September 1st, 2004, 12:43 PM
Peter Jamieson
external usenet poster
 
Posts: n/a
Default

It isn't clear what you are really trying to do here.

If you are using VBA to open your data source, it should be reasonably
obvious where to put the Subtype:= line - you find the existing
OpenDataSource method call, e.g.

OpenDataSource _
Name:="c:\mydbs\mydb.mdb", _
Connection:="TABLE mytable", _
SQLStatement:="SELECT * FROM [mytable]"

and change it to

OpenDataSource _
Name:="c:\mydbs\mydb.mdb", _
Connection:="TABLE mytable", _
SQLStatement:="SELECT * FROM [mytable]", _
Subtype:=wdMailMergeSubtypeWord2000

If you are not actually using VBA and are just trying to get Word 2002 or
2003 to open a .mdb using DDE, check Word Tools|Options|General|"confirm
conversions at open", then go through the process of connecting to the data
source again. In the Select Data Source dialog box, select the .ndb and
proceed. You should see an additional dialog. Choose the option with DDE in
it.

If the problem is that you are trying to get your Edit Recipients box to let
you edit records in Access, don't bother unless the .mdb is an "Office
Address List" (or is sufficiently similar that ord treats it the same way as
an Office Address List). Word recognises the structure of these databases
and allows editing in Edit Recipients.

--
Peter Jamieson

"Ravi" wrote in message
...
Where do you go to edit the datasource? Can you please
tell me step-by step where to go so I can edit this line
in:
Subtype:=wdMailMergeSubtypeWord2000
to make it DDE instead of OLEDB.

Thanks.

-----Original Message-----
When trying to run a mailmerge from Access 2003 I keep

getting "Unable to
open datasource" error. This used to work for me in

pervious versions of
Office, but now there seems to be some kind of locking

mechanism that
prevents Word from accessing the database.

Connection String

stConnect = "DSN=MEFDSN;DBQ=" & stDatabasePath

& ";DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;"

..OpenDataSource Name:=stDatabasePath, _
ConfirmConversions:=False,

ReadOnly:=False,
LinkToSource:=False, _
AddToRecentFiles:=False,

PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="",

WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto,

Connection:=stConnect,
SQLStatement _
:="SELECT * FROM `qryMailMerge` WHERE

ProsjektID = " +
stProsjektID, SQLStatement1:=""

The strange part is that it seems to work occasionally,

but most of the time
it does not.
.



 




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
Unable to open default email folders dunagan Installation & Setup 2 August 30th, 2004 09:41 PM
Unable to open OST file Vaughn gittin General Discussion 1 July 21st, 2004 08:20 PM
Unable to open files after installing Office 2003 Sriram Setup, Installing & Configuration 3 May 30th, 2004 05:42 PM


All times are GMT +1. The time now is 03:02 AM.


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