S
Salchow
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.
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.