If you have all this information at your finger tips, you are ready to proceed.
Using an outside database to create personalized documents is a three step process:
Locate the database and query the records.
To begin, select
->
from
the menubar. A dialog box will appear.
Click on
Open Existing...
. Another small dialog will appear.
Select
QT-SQL Source
and click on
OK
. A new dialog box will appear.
Enter the URL or IP address of the computer that holds the database in the text box labeled
Hostname:
.
Select the driver named
QMYSQL3
from the combo box labeled
Driver:
.
Enter the database name you were provided in the text box labeled
Database name:
and a
user name in the text box labeled
Username:
.
If the database access is through a port other than the default port enter that port number in the text box labeled
Port:
.
Tip
If you are going to be using this database at other times, you can click on the button labeled
Keep settings...
. KWord will ask for a descriptive name.
When you want to restore these settings on future sessions, simply select the descriptive name from the combo box in the
upper left of the dialog box.
When all information is correct, click
OK
. KWord will ask you for a password to that database. Enter
the password in the text box, and click
OK
.
KWord will now ask if you want to replace your current data source with the source you have selected. Click
Yes
.
You are now connected to the database. Now you need to select the data from the database. This dialog box has re-appeared.
Click on
Edit Current...
. Another dialog will appear.
This dialog is designed to help you enter and test your database query. The dialog is divided into three
sections: Database information, Query information and Query line.
The database information section is labeled
Information
and consists of two combo boxes. The
left combo box (
Available tables:
) gives you a list of all available tables within the current database.
Select the desired table from the list by clicking on the table name with the left mouse button.
A list of all available fields from that table will appear in the right combo box.
The query line is a text box located near the bottom of the dialog labeled
Query:
. Simply type your
SQL query into this text box and click
Execute
. KWord will query the database and return the specified query
in tabular format in the
Query Result
box. You can alter, or edit your query on the query line and each time you
click
Execute
, the new query results will appear.
Note
KWord does not limit your query strings. They can be simple and straight forward:
select * from Clients
Or complex multitable queries:
select Clients.FirstName, Clients.LastName, Clients.address, data.Birthday,
data.EyeColour from eMail, data where data.FirstName=Clients.FirstName and
data.LastName=Clients.LastName
Clicking
Setup
, will allow you to log into a different database.
When you have the correct query in the
Query:
text box, click
OK
to select that query.
This will return you to the mail merge main dialog box.
Click
Close
.
Now that you have selected your data query, it is time to insert the merge fields in the document. Click
here to continue.