View Single Post
  #10   Report Post  
Murray Muspratt-Rouse Murray Muspratt-Rouse is offline
Member
 
Location: Mill Hill, London, England
Posts: 44
Default

Hi Peter!

As soon as someone appeared in the office this morning I powered down the PC - this made no difference, as you probably expected. I then followed your instructions to use an empty .odc file and got the connection to work. My next problem is producing a .odc file for Word, so as to be able to get the merge fields into the document. All I get so far in the list of database fields is the Jet password! I obviously have a syntax problem - is the statement too long?. Here is what I have got: -

Provider=Microsoft.Jet.OLEDB.4.0;Password=""pixie7 826"";User ID=Murray M-R;
Data Source=C:\Documents and Settings\All Users\Documents\Age Concern Databases\clients2002.mdb;
Mode=Read;Jet OLEDB:System database=C:\Documents and Settings\All Users\Documents\Age Concern Databases\Secured.mdw;,
SQLStatement="SELECT * FROM 'MergeTable'", SQLStatement1:="", SubType:=wdMergeSubTypeAccess

Help!

Murray

[quote=Peter Jamieson;394515]If you don't need the Word object to connect, remove the relevant code
as it's probably a distraction.

However, I'm not sure you can manually connect Word to an Access data
source that has a securit database, unless the Admin username and a
blank password will give you access to the table you need. I think you'd
probably have to do it the way I suggested, at lleast for an OLE DB
connection. For a DDE connection, if the database is already open,
you're OK.

Even with an OLE DB connection, once you have set it up
programmatically, Word should retain the necessary connection
information. Whether it always uses it when you reopen the document is a
different matter.

Peter Jamieson

http://tips.pjmsn.me.uk

Last edited by Murray Muspratt-Rouse : February 9th 09 at 01:00 PM