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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |