View Single Post
  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
mico mico is offline
external usenet poster
 
Posts: 6
Default Database Field SQL Statement

Yes, this works:
DATABASE \d "C:\\Temp\\VerizonAirCard.mdb" \c "DSN=MS Access Database;DBQ=
C:\\Temp\\VerizonAirCard.mdb;DefaultDir= C:\\Temp;DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;UID=admin; " \s "SELECT *
FROM [tblAirCard] "

Also, it appears you can use just about anything in place of the tic mark
but you must use something to enclose the tblAirCard.

FWIW, I seem to be able to use Excel as a data source correctly and was even
able to use a Mergefield in a where clause of the SQL statement. This brings
up another question. Word does not automatically update the table fields
based upon the next Mergefield record. When I move from one record to the
next I have to press F9 to see the update fields. Below is the work around
noted in April 2006:
==========================================
OK, I've just checked here. You'll need to add a DWORD value called
FieldCalcSecurityLevel and set the value to 0, under the following registry
key:
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\W ord\Options
(Follow the instructions for the other versions of Word, but substitute 11.0
in the appropriate place. The instructions are in
http://support.microsoft.com/kb/330079/EN-US/
================================

Is this still the only way to work around this issue?
Thanks again.


"mico" wrote:

OS: XP Pro SP1, Word 2003 SP2

DATABASE \d "C:\\Temp\\VerizonAirCard.mdb" \c "DSN=MS Access Database;DBQ=
C:\\Temp\\VerizonAirCard.mdb;DefaultDir= C:\\Temp;DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;UID=admin; " \s "SELECT * FROM
'tblAirCard' "

Ive been unable to change the select statement above to work properly.
Ive tried to use tic, backslash and tic and backslash to denote the columns
names and Ive tried using the tablename.fieldname, tablename!fieldname and
just the field name by itself and everything generates the generic Word error
unable to open data source. Any advice is appreciated.