secure mde and mailmerge problem

J

Junior

I have a mailmerge document that uses a txt file as its primary datasource.

BUT it also has a hardcoded line (paragraph) that prints data from a query
in an access database

The Access application is split I have tried calling the query from the
secure Frontend get an error message that i don't have necessary
permissions to use the secure DB.

I currently call the query from the nonsecure Backend, but the BE is on the
server and sometimes the application hangs



The code below works if i reference the path to the Backend mdb. but doesn't
work from the Frontend because once word opens the user doesn't have
permissions to the query in the secure Access FrontEnd



{DATABASE \d "C:\\Test\\TestA.mde" \c "DSN=MS Access
Database;DBQ=C:\\Test\\TestA.mde;DriverId=25;FIL=MS
Access;MaxBufferSize=512;PageTimeout=5;" \s " select ItemDesc FROM
\"qLtrMissItem\" where AppID=13}



So...instead of calling a query as in the line above, is it possible to use
a second txt file to print this paragraph - i can create the text file in
Access but don't know how to code the mailmerge document.

Say if access exported the query data to a text file C:\MissItem.txt could
the mailmerge doc use this txt file to print?



Thanks, seeking this solution or advice
 
P

Peter Jamieson

If you can get the text out into a text file, you can use an INCLUDETEXT
field to include it. However,
a. you will need to generate all the necessary text files before you merge
b. you won't be able to insert a Word table using that technique - if
you need one you'd have to postprocess the merge output.

Other things you could try are:
a. include the security information necessary to access the frontend
database/query in the \c parameter. You might need to specify a system
(workgroup) database, username and password. However, they would all be
in plain text, potentially undermining security.
b. if you are using Word 2002 or later, use VBA and the Word Mailmerge
events to get the data and insert it when you merge (e.g. you could use
ADO to access the data. But again, you would either need to hard-code
the security info (somewhere) or ensure that your ADO code prompted the
user for the necessary info.

If you are matching the AppID in your DATABASE field with an AppID in
your primary data source, you can build an INCLUDETEXT by nesting
fields in your primary data source, e.g.

{ INCLUDETEXT "c:\\mydbtexts\\text{ MERGEFIELD AppID }.txt" }

Peter Jamieson
 
J

Junior

Peter - using Word 2K and Access 2K - sorry - i am very weak using mailmerge
better with Access - it took many hours and lots of trials to get this
letter to this point.
FYI- the mailmerge document is a letter - the txt datasource provides name
address, etc. The extra hardcoded line uses the query to produce an itemized
list that is a word table.
I would like to try your suggestion (including the security information in
the \c parameter) - the workgroup name and path is already available in the
shortcut so i don't think this would further undermine security.

could you show me an example od the \c parameter using workgroup- ABC.MDW,
username-User and no password.
thanks
 
P

Peter Jamieson

Peter - using Word 2K and Access 2K - sorry - i am very weak using mailmerge
better with Access - it took many hours and lots of trials to get this
letter to this point.
FYI- the mailmerge document is a letter - the txt datasource provides name
address, etc. The extra hardcoded line uses the query to produce an itemized
list that is a word table.
I would like to try your suggestion (including the security information in
the \c parameter) - the workgroup name and path is already available in the
shortcut so i don't think this would further undermine security.

could you show me an example od the \c parameter using workgroup- ABC.MDW,
username-User and no password.

I would start with

{DATABASE \d "C:\\Test\\yourfrontenddb.whatever" \c "DSN=MS Access
Database;DBQ=C:\\Test\\TestA.mde;DriverId=25;FIL=MS
Access;MaxBufferSize=512;PageTimeout=5;SystemDB=c:\\ABC.mdw;UID=User;PWD=;"
\s " select ItemDesc FROM
\"qLtrMissItem\" where AppID=13 }

Peter Jamieson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top