SQL Direct User Guide
SQL Direct User Guide
User Guide
Disclaimer
Information of a technical nature, and particulars of the product and its use, is given by AVEVA
Solutions Ltd and its subsidiaries without warranty. AVEVA Solutions Ltd and its subsidiaries disclaim
any and all warranties and conditions, expressed or implied, to the fullest extent permitted by law.
Neither the author nor AVEVA Solutions Ltd, or any of its subsidiaries, shall be liable to any person or
entity for any actions, claims, loss or damage arising from the use or possession of any information,
particulars, or errors in this publication, or any incorrect use of the product, whatsoever.
Copyright
Copyright and all other intellectual property rights in this manual and the associated software, and every
part of it (including source code, object code, any data contained in it, the manual and any other
documentation supplied with it) belongs to AVEVA Solutions Ltd or its subsidiaries.
All other rights are reserved to AVEVA Solutions Ltd and its subsidiaries. The information contained in
this document is commercially sensitive, and shall not be copied, reproduced, stored in a retrieval
system, or transmitted without the prior written permission of AVEVA Solutions Ltd. Where such
permission is granted, it expressly requires that this Disclaimer and Copyright notice is prominently
displayed at the beginning of every copy that is made.
The manual and associated documentation may not be adapted, reproduced, or copied, in any material
or electronic form, without the prior written permission of AVEVA Solutions Ltd. The user may also not
reverse engineer, decompile, copy, or adapt the associated software. Neither the whole, nor part of the
product described in this publication may be incorporated into any third-party software, product,
machine, or system without the prior written permission of AVEVA Solutions Ltd, save as permitted by
law. Any such unauthorised action is strictly prohibited, and may give rise to civil liabilities and criminal
prosecution.
The AVEVA products described in this guide are to be installed and operated strictly in accordance with
the terms and conditions of the respective license agreements, and in accordance with the relevant
User Documentation. Unauthorised or unlicensed use of the product is strictly prohibited.
First published September 2007
AVEVA Solutions Ltd, and its subsidiaries
AVEVA Solutions Ltd, High Cross, Madingley Road, Cambridge, CB3 0HB, United Kingdom
Trademarks
AVEVA and Tribon are registered trademarks of AVEVA Solutions Ltd or its subsidiaries. Unauthorised
use of the AVEVA or Tribon trademarks is strictly forbidden.
AVEVA product names are trademarks or registered trademarks of AVEVA Solutions Ltd or its
subsidiaries, registered in the UK, Europe and other countries (worldwide).
The copyright, trade mark rights, or other intellectual property rights in any other product, its name or
logo belongs to its respective owner.
Contents
Page
User Guide
About this Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
Scope of this Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
About this User Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
Some Useful WWW Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:2
Reference Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:2
12.0
Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a New Table Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing an Existing Table Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4:4
4:6
4:6
4:7
4:10
4:10
4:10
4:11
4:11
4:11
4:11
4:12
ii
12.0
1.1
1.2
Note: This User Guide assumes that you are familiar with PDMS DESIGN/Outfitting
Design.
1:1
12.0
1.3
1.4
URL
http://msdn2.microsoft.com/en-us/data/
default.aspx
http://msdn.microsoft.com/default.asp
http://www.microsoft.com/sql/
Reference Material
System Administrators may find the following useful:
1:2
12.0
2:1
12.0
Although not necessary to access data through OLE DB and ADO, you can enhance SQL
Direct using Microsoft SQL Server (or Microsoft SQL Desktop Engine (MSDE), which is an
equivalent but earlier product).
SQL Server provides access to additional functionality by acting as a data consumer and
then providing a relational view of the data to other applications, for example Microsoft
Access, through its "linked server" facility. This mode of data access can be further wrapped
as an ODBC data source.
We have tested SQL Direct with MSDE 2000, Service Pack 4. However, throughout the rest
of this document we will refer to Microsoft SQL Server, or simply SQL Server.
2.1
configure SQL Direct with the necessary paths and environment variables to match
the particular project database or databases you wish to access.
design a set of tables that defines the structure of the data to be passed to the data
consumer. SQL Direct comes with some preconfigured tables, although you may also
design your own.
configure SQL Server with the necessary data views to match the tables you have
defined.
See SQL Direct Components, Using SQL Direct Components and Using SQL Direct - Some
Examples for more details of these operations.
2:2
12.0
3.1
3.1.1
SQL Direct Configuration allows you to configure SQL Direct with connection information to
match the particular project databases you want to access. Using the tools menu, you can
also start the Table Designer, start and stop the PDMS Server and SQL Server processes,
and configure data views within SQL Server.
3:1
12.0
3.1.2
Menu Option
Function
New Connection
Test Connection
Properties
Exit
Edit Menu
Menu Option
Function
Cut
Copy
Paste
3:2
12.0
Menu Option
Function
Paste New
Delete
Tools Menu
Menu Option
Function
Start SQLEXPRESS
Starts the SQL Server process (for the chosen SQL Server
instance).
Stop SQLEXPRESS
Stops the SQL Server process (for the chosen SQL Server
instance).
Configure SQLEXPRESS
3:3
12.0
3.2
Table Designer
The Table Designer enables you to define tables of PDMS data. Within each table, you can
define one or more row types and column names, and the data item to fetch for each. Once
you have defined and saved your table definitions, SQL Direct can use them to determine
which data to pass to a data consumer that requests information from the database.
See Using the Table Designer for full details
3.3
PDMS Provider
The software component that coordinates the provision of data to a data consumer (i.e. a
client application) is called the data provider.
During normal, day-to-day operation of SQL Direct, the PDMS data provider works invisibly,
automatically forming data rowsets in response to data requests from client programs.
The underlying technology that supports the interaction between data providers and data
consumers is called Object Linking and Embedding Database (OLE DB), and data providers
and consumers are more fully known as OLE DB Providers and OLE DB Consumers.
3.4
PDMS Server
All data access by SQL Direct to and from PDMS is handled by a program called the PDMS
Server. This program is started up automatically as required by the PDMS Provider, and
also Table Designer.
PDMS Server uses the connection details defined in SQL Direct Configuration to link to
named projects and MDBs.
Login to PDMS uses normal user names and passwords, and access levels are determined
by the access levels granted to that user.
When a client first connects to PDMS Server, these three pieces of connection information
must be established:
3:4
12.0
the password.
For convenience you can store this information in a client application's cache or save file.
Microsoft Office clients, for example, offer the opportunity to store this information for future
access. If a client application supplies this information, operation of PDMS Server is
completely invisible.
Note: You should be aware that retaining passwords in client caches weakens data
security.
If security is important then you should not retain passwords in client caches. When a client
connects to PDMS Server without full connection information, PDMS Server will invite you
to provide the missing information on a login form:
After login, the operation of PDMS Server is normally automatic and requires no user
intervention. PDMS Server will run until you log out of Windows, or shut down your machine.
However, you can also start and stop PDMS Server manually through the Tools menu of
SQL Direct Configuration.
You can also start PDMS Server through the shortcut on the SQL Direct program menu. In
this case, a Command window is displayed once PDMS has been connected to, providing
diagnostic output of commands as they are executed by PDMS Server.
3.5
3:5
12.0
3:6
12.0
4.1
4.1.1
4:1
12.0
Field
Purpose
Connection String
Standard Variables
4:2
12.0
Field
Purpose
Project Details
Database Variables
These tell PDMS where the database files are for your
project. Note that the labels reflect the name of the
project: so if the project is "SAM" the labels are SAM000,
SAMMAC, etc. You need to fill in only these: the PIC and
ISO fields are for future use and you can leave them
blank.
More Env Vars gives you the opportunity to define any
further environment variable setting required for this
PDMS project, for example foreign database locations.
The field contains the name of a file holding further
environment variable definitions, one per line, in the
format: SET <varName>=<value>.
You may use the Browse... button to locate these
locations.
When editing with this form, the OK and Apply buttons allow you to save the changes. The
OK button additionally dismisses the form; and you can discard changes using the Cancel
button.
You can test to see if the connection details are correct using the Test Connection button.
This launches a separate program, ADOTest, to test the connection as a Microsoft Active
Data Object (ADO) client.
4.2
4.2.1
Choose Tools >Start Table Designer... from the SQL Direct Configuration menu.
Whichever route you choose you will need to complete the login details for the project you
wish to connect to (unless PDMS Server is already running and logged in to PDMS with the
correct details):
4:3
12.0
Field
Purpose
User Name
Password
Your password.
Connect String
When a Table Schema file already exists for this connection, Table Designer displays the
main form for that table schema (see below). If no table schema file already exists the main
window is empty:
4.2.2
Basic Concepts
The Table Designer opens showing the current table schema, if there is one. The table
schema maps to the current project database. SQL Direct uses table schemas to define
which data to pass to a data consumer when requested.
You can use the Table Designer to add new tables or modify or delete existing ones.
4:4
12.0
Some Definitions
Term
Definition
Table
Column
Table row
Data row
Binding
Key column
4:5
12.0
4.2.3
4.2.4
on the toolbar.
With a populated table schema, the Table Designer main form looks like this:
4:6
12.0
The left hand pane lists the tables and column names as a tree. The right hand pane list the
table rows and associated column attribute bindings in a grid.
4.2.5
Creating a Table
To create a table:
1. Open an existing Table Schema or create a new one as described above.
2. Insert a new table and give it a name.
3. Define the table columns and the table rows.
Inserting and Naming a New Table
Choose Insert>Table, click
Insert Table.
Table Designer creates a new table and selects the default name "NEWTABLE". We
recommend you change this to a more meaningful name.
Choose a name that describes the purpose of this table, e.g. "SITES" or "PIPING". You
can use letters, numbers and underscores in the table name, but you cannot use spaces.
The right hand pane should now show a column heading labelled "Rows of".
This column lists all the element types that provide the data for this table.
4:7
12.0
Similarly to when you create a new table, the column will have a default name,
NEWCOLUMN. Choose a new name (e.g. "REFNO" or "NAME") and press Enter. Note
that column names can contain spaces.
The new name appears in the right-hand pane. Repeat this process for all the columns that
you need. Note that Table Designer inserts the new column to the right of the current
selection, so if you select a column, it inserts the new column to the right of the selected
column; but if you select the table name, it inserts the new column as the first column in the
list.
Note: If you select a column in the left-hand pane, only that column will appear alongside
the "Rows of" column in the right-hand pane.
If you select the table name, the right-hand pane shows all columns of that table.
When youve inserted the columns, your Table Designer should look something like this:
4:8
12.0
Important: If you want to write data back to the database, one of your columns must map to
REFNO or NAME. We recommend you use REFNO.
on the toolbar.
A drop-down list will appear under the "Rows of" column in the right-hand pane. Click on the
down-arrow and select an element type from the list. PDMS Provider locates all elements of
this type when it retrieves data.
If you labelled any columns with the exact name of an element attribute, e.g. "REFNO",
Table Designer fills in the attribute for you; Table Designer assumes if the name of a column
matches an attribute name, then that is the attribute you want.
If there are any entries along your row under the headings marked "unset", then you
need to tell Table Designer which attribute provides the data for that column, i.e. you need to
set the binding for that column. Double click on the word "unset" and select the attribute
you want from the drop-down list. The list contains all the attributes for the type listed in that
row.
Having selected an attribute for an "unset" (or changed one that Table Designer put in by
default), Table Designer will attempt to re-use that attribute in any subsequent rows you may
add. In other words, it looks at the bindings for the row immediately above the new row
when choosing defaults, and uses the column names for the first row. It is quicker therefore,
to get the first row exactly right, then add new rows, rather than add all the rows before
checking the bindings.
Repeat from Inserting and Naming a New Table to create all the tables that you need.
To save the table you just defined as a .tsf file, select File>Save, or File>Save As, or
click
on the toolbar.
4:9
12.0
4.2.6
4.2.7
on the
on the
Load a Table
To load a table schema, select File>Open, or click
displays the currently active table schema on startup.
Note that Schema>Reload Table Schema (
have made to the current table schema.
4.2.8
Writeable Data
If you have followed the above procedure, you now have a set of read-only tables. You
should also notice that every Edit menu command (Edit>Undo, Cut, Copy, Paste and
Change, and the equivalent toolbar buttons) and the Toggle read-only flag toolbar button
(
) is disabled.
This is because you can only mark rows as writeable if you also define a key column.
SQL Direct Configuration uses the key column to identify an element when it is writing data
back, so you need to specify either the REFNO or the NAME as the key column. Table
Designer does not enforce this - in theory you can mark any column as the key, but in
practice only REFNO or NAME are useable.
Select the required column in the left-hand pane, then select Schema>Key Column, the
button, or right-click on a column name and select Key Column.
Once you have marked a key column, you can turn off the read-only flag for any other
column by selecting Schema>Read Only, clicking
on the toolbar, by or right-clicking on
a column name and selecting Read Only).
4:10
12.0
Remember that the onus is on the person designing the table to ensure that writing to that
attribute is sensible. Table Designer does not enforce any rules about attributes that must be
read-only.
4.2.9
Checking a Table
At any time you can select Schema>Check Selected Table or click
check your table file for consistency. This process involves checking:
4.2.10
on the toolbar to
Note: Valid binding here means the attribute specified is an attribute of the element type,
not that it necessarily makes sense in the overall context of the table.
If the check does detect any errors, you can correct them as they are discovered.
Note: If you are working on the active table schema, you cannot save it to the same file if it
contains any errors. You have to save to a different file.
Schema>Check Table (
the tree view.
4.2.11
4.2.12
, then your table schema has been checked and is OK (within reason - see
, then the table schema has been checked but there are errors.
If hes undecided
the table schema.
, it means that you have made some changes but havent yet checked
The panel to the right of the smiley indicates whether or not you are editing the "active" table
schema file (i.e. the one that SQL Direct Configuration is configured to use for the current
connection). The
icon in here reminds you that making changes may be dangerous.
The third icon panel
indicates whether or not you have made changes to the file and
have not yet saved them.
4:11
12.0
4.2.13
4:12
12.0
You have used the Table Designer to set up some tables. See Table Designer and
Using the Table Designer.
5.1
5:1
12.0
Note: The list of data sources may differ from that shown above.
3. Any previous data source connections appear in this list and can simply be selected
and opened using the Open button. This takes you directly to the Import Data screen
shown at Step 10 below.
4. To create a connection to a new data source, click the New Source button and select
Other/Advanced on the Data Connection Wizard list displayed:
5. Click the Next> button and select PDMSProv OLE DB Provider 12.0 on the Data Link
Properties list displayed:
5:2
12.0
6. Clicking the Next>> button will take you to the Connection tab of this Data Link
Properties form:
5:3
12.0
7. Fill in the Data Source field with the connect string for the connection, and fill in the
User Name and Password. You may have to uncheck the Blank Password check box
before you can supply the password.
8. Clicking the OK button brings you to the Select Database and Table page of the Data
Connection Wizard:
9. Select the table you wish to display and click the Next> button. This gives you an
opportunity to name and save the link on the Save Data Connection File and Finish
page:
10. Click the Finish button and Open the new link on the next screen. This leads to the
final Import Data screen:
5:4
12.0
11. Finally press the OK button and the table will be displayed on the Excel page:
Note: Data read into an Excel spreadsheet in this way can be edited if desired. However,
there is no link back to PDMS, and changes made this way will not be reflected in the
database.
Data can be modified when necessary using PDMS itself (e.g. a modify, create or
delete operation) and should be followed by a Savework operation. When this has
been done, executing a Refresh Data command in Excel will result in a
corresponding change taking place in the spreadsheet (the Refresh Data command
is on the Data menu, or you can click the icon.)
If you configure SQL Direct for use with SQL Server (see Using SQL Direct with
Microsoft SQL Server) you can modify the data with an SQL Query. To do this,
position the cursor outside the imported data, and select Data>Import External
Data>New Database Query. Select New Data Source and click OK. Enter any
name of your choosing for the data source, and select SQL Server as the driver.
Click the Connect button and enter (local) as the server; click OK, then OK again.
5:5
12.0
With your new data source highlighted, click OK; this brings up the Microsoft Query
window. Close the Add Tables dialog that appears, and click the SQL button in the
menu bar or select View>SQL Enter an SQL Query to update your data and click
OK. Click OK to the 'SQL Query can't be represented graphically' warning, and
again to the 'SQL statement has been executed successfully' message. Close the
Microsoft Query window, clicking Yes to the 'You have not created a query containing
data' warning. Finally, execute a Refresh Data command in Excel to see your
updated data.
You can save your Excel spreadsheet. After reloading, you may find that the Refresh
Data command does not work. This is because your password will not be saved in
the file by default. Edit the query (right click the data grid and select Edit Query)
and add the Password=<password>; option to the connection details.
You can email your Excel spreadsheet, with its current content, to another SQL
Direct user. The recipient can refresh the data from his own SQL Direct
configuration, providing he edits the query (right click the data grid and select Edit
Query) to enter his own connection details. He will also need the right table
definitions in his table schema file.
5.2
5:6
12.0
3. Fill this in for the connection you want to test and the main form will be populated as
follows:
5:7
12.0
4. Select a table from the list and then the Table>Query Rows menu option (or you can
simply double-click the table). This displays the data in the right hand pane:
5.3
5:8
12.0
Select a cell to edit by clicking inside it with the mouse cursor. The field editor box labelled
Cell Text displays the field's value:
Type the new value into the editor and press the Update Cell button to copy the value back
to the cell in the grid:
Continue to edit fields in this way as desired. The values have not been written back to
PDMS yet. This happens when you close the connection, for example by selecting the
PDMS> Close Connection menu option. This gives you the opportunity to accept or reject
the changes:
5:9
12.0
If you click Yes the changes will be committed in PDMS. Clicking No aborts the changes. In
either case the connection is subsequently closed.
To see the code behind this example you can look at the ADOTest Visual Basic source
provided in the samples directory.
5:10
12.0
6.1
Introduction
This chapter details using SQL Direct with Microsoft SQL Server.
Note that you can use PDMS Provider from many clients, for example Excel, or clients using
Microsoft Active Data Object (ADO) technology, without the involvement of SQL Server.
Using SQL Direct - Some Examples details some of these methods of use.
However if you want to make more sophisticated SQL queries against the PDMS tables, or
if you want to join PDMS rowsets with data obtained from other providers, SQL Direct
requires SQL Server to do the SQL processing involved.
6.2
6.3
6.3.1
6:1
12.0
6.3.2
(Unfortunately, there is no suitable tool actually provided with MSDE 2000, but all the above
products can be used successfully with data in MSDE.)
These products initially provide a "tree view" of the data within SQL Server. You can expand
each branch, down through different databases to individual tables and data views. The
SQL Direct Configuration Configure SQL Server option will have created data views within
the "master" database on your SQL server, the views being named according to the tables
you created in Table Designer, and saved in your table schema file referenced in your
connection settings.
You can retrieve data from data views by right-clicking on them and selecting Open View or
Retrieve Data From View (depending on which product you are using).
You can also open a SQL command window and execute SQL statements. (In Visual Studio
.NET 2003 you need to have retrieved data from the view first in order to open the SQL
window, as the 'SQL' option on the query menu bar is greyed out until you have done this.)
Once you have opened a SQL command window you can access PDMS data using SQL
queries. For example:
SELECT *
FROM EQUIPMENT
WHERE REFNO = '=12345/67'
Where EQUIPMENT is a table you created in Table Designer, REFNO is a column name
and =12345/67 is a value of REFNO. Note the use of single quotes around character data
values.
Full documentation of the SQL Query language and its use is beyond the scope of this user
guide. There are many texts available, both online and in book form.
6.3.3
6:2
12.0
you wish to change, edit the value, then move the cursor off the row. SQL will update the
data in the database.
Note: If you are using SQL Server 2000 / MSDE, you need to make sure that the Microsoft
Distributed Transaction Coordinator (DTC) is running before you can update data by
editing the output grid. The DTC can by started up / stopped through the SQL Server
Service Manager
The SQL INSERT statement is not supported by PDMS Provider at this time, neither
is inserting data by adding rows to the output grid.
6.4
6.4.1
6:3
12.0
The list of data provider applications may differ from that shown above.)
4. Select the PDMS ODBC data source you created earlier (see Setting up SQL Server).
If you created a System DSN (rather than a File DSN) it will be on the "Machine Data
Source" tab (rather than the "File Data Source" tab). Click OK; the Link Tables dialog
box will appear:
5. The list in the Tables tab will show the available PDMS tables (as defined using the
SQL Direct Table Designer) as well as a number of SQL Server system tables which
can be ignored. Select the required table(s), then click OK.
6. The Link Tables dialog box will change its appearance and the Select Unique Record
Identifier dialog box will appear:
6:4
12.0
7. The Select Unique Record Identifier dialog box asks you to select a field (or fields)
from the selected table that will uniquely identify each record. Choose REFNO, and
click on OK.
The requested table(s) will now appear within the Tables tab of the Database dialog box in
Access. Double-click on the appropriate table name to view the data in tabular form.
Note: Data in the output grid corresponding to updatable attributes in PDMS can be
updated by changing the value(s) and moving the text cursor off the row. In order for
this to work, however, you must have started the Microsoft Distributed Transaction
Coordinator (DTC) through the SQL Server Service Manager tool.
6.4.2
6:5
12.0
9. Fill in the Data source - the connection settings name you saved in SQL Direct
Configuration, your User name and Password (deselect the "blank password" option),
and select "Allow saving password" if you wish. Then click OK.
10. You are now offered the option to select your database - there should only be one so
just click Next.
11. Fill in a file name for the connection (if you wish, or just use the default) and again
select the "save password in file" option if you wish. Then click Finish.
12. You can now select which table(s) you wish to link to the current project (or all tables if
you wish). Make your selection and click Finish.
Access will now create the linked tables. Double-click on the appropriate table name to view
the data in tabular form.
The linked tables created in this way are once again data views, very similar to the ones that
SQL Direct Configuration creates, except that Access creates a separate database for each
Access project in which to place the views.
6.5
6.5.1
) on the Database
3. Click on Get Data The Select Data Source form will appear.
4. If you have not already created a named data source, click on New Source The
Data Connection Wizard will appear. Choose Microsoft SQL Server, and click
Next>.
5. Enter a single dot (".") for the server name and click Next>.
6. Highlight the table you wish to use, and click Next> again.
7. Select a file name for your data connection, and click Finish.
8. The Select Data Source form reappears - make sure your named data connection is
highlighted and click Open.
9. The Database dialog box reappears. Optionally click on the Query Options button,
and enter any data restrictions you wish to impose on the data returned.
10. Finally click on the Insert Data button and select the data records you want from the
Insert Data dialog box.
The requested data will now appear in your current Word document as a table.
6.5.2
6:6
12.0
) on the Database
3. Click on Get Data The Select Data Source form will appear.
4. Select MS Query from the Tools menu. Microsoft Query will start up, and the
Choose Data Source dialog box will appear.
(The list of data provider applications may differ from that shown above.)
5. Select the Use the Query Wizard to create/edit queries check box.
6. Click on the ODBC resource in the list corresponding to the database where the PDMS
views were created (see Method 1 - Linking to PDMS Data through ODBC
(recommended) for a description of how to do this) and OK the dialog box. The Query
Wizard - Choose Columns dialog box appears:
7. The Available tables and columns: list will show the available PDMS data tables
(defined using the SQL Direct Table Designer). Select the required table, then click
. The column headings for the selected table will appear in the Columns in
your query: box.
8. Click Next>. Keep clicking Next> as the wizard dialog progresses (unless you wish to
perform other operations at each stage) until the Query Wizard - Finish dialog box
appears. Click Finish.
6:7
12.0
9. Returning to the Database dialog box, click Insert Data The Insert Data dialog box
then appears, which gives you some options for the formatting and content of the
imported data. OK the form.
The requested data will now appear in the current Word document as a table.
6.6
3. Select
to activate a "wizard" to create a standard report. The Create Report
Expert dialog box will appear:
4. Step 1 (the Tables tab) enables you to specify the type of data source. Click on
and select ODBC - PDMS from the list in the resulting Log On Server dialog box (your
System Administrator may have installed and configured your SQL Direct service
provider to show text other than 'PDMS') and OK the dialog box.
5. The Choose SQL Table dialog box will appear. From the SQL Tables list choose the
table (previously defined using SQL Direct's Table Designer) which contains the data
you wish to report on. Having selected the table, click Add; the selected table name will
appear in the main list area on the Create Report Expert dialog box (Tables tab).
6. On the Choose SQL Table dialog box click
to redisplay the Log On
Server dialog box. Now select ODBC - MS Access 7.0 Database from the list to
specify (in this example) the source of the data which is to be merged with the already-
6:8
12.0
specified data table, and which is to be reported on. OK the dialog box. The Select
Database dialog box appears.
7. Navigate to the appropriate Access .mdb file and OK the Select Database dialog box.
The Choose SQL Table dialog box will reappear. From the SQL Databases list select
the MS Access 7.0 Database previously selected. The SQL Tables list will become
populated with the names of the tables present in the selected Access database.
Having selected the table, click Add, then Done.
This completes step 1 of the Create Report Expert process.
8. Step 2 of the Create Report Expert process consists of linking the PDMS data table
with the Access data table. The Links tab shows lists of column headings in the two
tables. 'Join' the tables by selecting (left mouse button) a common column heading in
one table; with the mouse button held down, move the cursor over to the same column
heading in the other table and release the button. A line will appear joining the two
tables via the common column heading. The 'joint' table to be reported on has now
been defined. Click on
assemble the required group fields in the Group Fields: list. Click
have completed this process.
when you
6:9
to
12.0
6:10
12.0
Index
D
Data Fields
writing back to PDMS . . . . . . . . . . . . 5:8
SQL Server
configuring . . . . . . . . . . . . . . . . . . . . 6:1
setting up . . . . . . . . . . . . . . . . . . . . . 6:1
using with SQL Direct . . . . . . . . . . . 6:1
Status Bar . . . . . . . . . . . . . . . . . . . . . . 4:11
M
Microsoft Access
using with SQL Direct . . . . . . . . . . . . 6:3
Microsoft SQL Server . . . . . . . . . . . . . . . 6:1
P
PDMS Connection Details
specification . . . . . . . . . . . . . . . . . . . 4:1
PDMS Data
accessing through SQL . . . . . . . . . . 6:2
linking to through ODBC . . . . . . . . . . 6:3
linking to through OLE DB . . . . . . . . 6:5
reading from Microsoft Visual Basic Program
using ADO . . . . . . . . . . . . . . 5:6
reading into Crystal Reports . . . . . . . 6:8
reading into Microsoft Excel . . . . . . . 5:1
reading into Microsoft Word . . . . . . . 6:6
writing through SQL . . . . . . . . . . . . . 6:2
PDMS Provider . . . . . . . . . . . . . . . . . . . . 3:4
PDMS Server . . . . . . . . . . . . . . . . . . . . . 3:4
S
SQL Direct
setting up . . . . . . . . . . . . . . . . . . . . . 2:2
use on Shared PCs . . . . . . . . . . . . . 3:5
SQL Direct Configuration . . . . . . . . . . . . 3:1
menu options . . . . . . . . . . . . . . . . . . 3:2
T
Table
adding columns . . . . . . . . . . . . . . . . 4:8
adding rows . . . . . . . . . . . . . . . . . . . 4:9
checking . . . . . . . . . . . . . . . . . . . . . 4:11
creating . . . . . . . . . . . . . . . . . . . . . . 4:7
inserting . . . . . . . . . . . . . . . . . . . . . . 4:7
naming . . . . . . . . . . . . . . . . . . . . . . . 4:7
Table Columns
Querying . . . . . . . . . . . . . . . . . . . . 4:12
Table Data
loading . . . . . . . . . . . . . . . . . . . . . . 4:10
saving . . . . . . . . . . . . . . . . . . . . . . 4:10
Table Designer . . . . . . . . . . . . . . . . . . . . 3:4
starting . . . . . . . . . . . . . . . . . . . . . . . 4:3
using . . . . . . . . . . . . . . . . . . . . . . . . 4:3
Table Schema
activating . . . . . . . . . . . . . . . . . . . . 4:11
checking . . . . . . . . . . . . . . . . . . . . . 4:11
creating . . . . . . . . . . . . . . . . . . . . . . 4:6
editing . . . . . . . . . . . . . . . . . . . . . . . 4:6
Tables
editing . . . . . . . . . . . . . . . . . . . . . . 4:10
querying . . . . . . . . . . . . . . . . . . . . . 4:12
W
Writeable Data . . . . . . . . . . . . . . . . . . . 4:10
Index page 1
12.0