Field codes: Database field

Microsoft Office Word 2003

toolbar.

Security  When you connect to a data source, be sure that your password is not readable by others. For example, do not store it where it is readable as plain text, such as in a macro. Do not send it on the Internet unless you use the Secure Sockets Layer (SSL) protocol, which encrypts data. You can tell whether a Web address uses SSL if the address starts with "https" instead of "http."

ShowSwitches

\b "Sum"

Specifies which attributes of the format set by the \l switch to apply to the table. If the \l switch is blank, the \b switch value must be 16 (AutoFit). Include the sum of any combination of the following values to specify the value for the switch.

For example, the switches \l "3" \b "11" apply only the borders, shading, and color attributes of the table format set by the \l switch.

This value Specifies
0 None
1 Borders
2 Shading
4 Font
8 Color
16 AutoFit
32 Heading Rows
64 Last Row
128 First Column
256 Last Column
\c "ConnectInfo"

Specifies a connection to the data. For example, a query to a Microsoft Access database might contain the connection instructions \c "DSN=MS Access Databases; DBQ=C:\\Data\\Sales93.mdb; FIL=RedISAM;".

\d "Location"

The path and file name of the database. Used for all database queries except a query to an SQL database table using ODBC. Use double backslashes in the path— for example, "C:\\Data\\Sales94.mdb".

\f "StartNumber"

Specifies the record number of the first data record to insert— for example, \f "2445".

\h

Inserts field names from the database as column headings in the resulting table.

\l "Format#"

Applies a format from the Table AutoFormat dialog box (Table menu) to the result of the database query. The number Format# is determined by the table format you select in the dialog box. If this switch is used and the \b switch doesn't specify the table attributes, Word inserts an unformatted table.

\o
Inserts data at the beginning of a merge.
\s "SQL"

SQL instructions. You must insert a backslash (\) before each quotation mark in the instructions. For example, instructions for a Microsoft Access database might be as follows:
"select * from \s \"Customer List\"".

\t "EndNumber"

Specifies the record number of the last data record to insert— for example: \t "2486".

ShowExamples

The following field results from a query to a Microsoft Access database through ODBC using the Database command:

{ DATABASE \d "C:\\Data\\Sales93.mdb" \c "DSN=MS Access Database; DBQ=C:\\Data\\Sales93.mdb; FIL=RedISAM" \s "select * from \"Customer List\" " \f "2445" \t "2486" \l "2" }