![]() |
| Previous Top Next |
ADO Connections |
The ADO Connections option enables you to connect to a DB via ADO. In this section, the connection via ADO is described for two cases:
| • | A Microsoft SQL Server database (as an example of non-XML DBs). |
| • | An IBM DB2 database (an XML DB; currently, IBM DB2 databases are the only XML DBs that are supported). |
To connect via ADO to any DB other than an MS Access DB (whether non-XML or XML), you build a connection string to that DB. In the Open Database dialog (screenshot below), click the ADO Connections button.

Build the ADO connection string as follows:
| 1. | In the ADO Connection screen, click Build. This pops up the Data Link Properties dialog. |

| 2. | Select the provider (driver) to connect to the DB. (For SQL DBs, we recommend Microsoft OLE DB Provider for SQL Server; for Oracle, MySQL, Sybase, and IBM DB2 DBs, Microsoft OLE DB Provider for ODBC Drivers.) Then click Next. This takes you to the Connection tab. |

| 3. | Enter the name of the server, server log-on information, and the DB name, all of which are user-specific. If, for the log-on information, you enter a required password, note that you must check "Allow saving password" to save the password in the connection string. Otherwise the connection will fail. |
| 4. | Click Test Connection to test whether a connection can be successfully made with the connection string you have built. If a password has been entered, it will be used for testing the connection. However, the password will be saved in the connection string only if the "Allow saving password" option has been checked (see Step 3). |
| 5. | If the connection test fails, rebuild the connection string correctly. If the connection test is successful, click OK to complete. The connection string you build is entered in the ADO Connections screen. A password will be entered in the connection string only if the "Allow saving password" option is checked. |
| 6. | Click Next. The connection is made and a dialog appears in which you select the required DB tables. How to select the required DB tables is described in the section DB Data Selection. |
| Note: | The following points about non-XML DBs should be noted: |
| • | The following providers (drivers) are recommended: (i) For Microsoft SQL DBs: Microsoft OLE DB Provider for SQL Server; (ii) For Oracle, MySQL, Sybase, and IBM DB2 DBs (versions prior to version 9 are non-XML), Microsoft OLE DB Provider for ODBC Drivers. |
| • | If a password is required to access the DB, it must be saved in the connection string. |
| • | All the connection information is stored in the SPS in the form of a connection string. It is therefore important that all clients that use this SPS must have the same driver installed so that they will correctly use the connection string. |
| • | If an ADO connection is used, hierarchical relationships in Oracle and Sybase DBs are ignored and only flat schemas are generated from these DBs. |
To connect to an IBM DB2 database via ADO, do the following:
| 1. | In the Open Database dialog, select ADO Connections (screenshot below). |

| 2. | Click the Build button. The Data Link Properties dialog pops up. |
| 3. | In the Provider tab of the Data Link Properties dialog, select Microsoft OLE DB Provider for ODBC Drivers (screenshot below), and click Next. |

| 4. | In the Connection tab (screenshot below), select Direct Server Connection, and in the combo box for the server, select the server on which the DB is located. Then select the DB on that server. |

| 5. | Enter your user name and password. |
| 6. | Test the connection to the DB by clicking the Test Connection button. If the test fails, you will have to correct the connection data. |
| 7. | After the connection has been successfully tested, check the Allow Saving Password check box. This step is necessary to save the password information in the connection string. The Connection tab of the Data Link Properties should look something like the screenshot above when you are done. |
| 8. | Click OK. The connection string you have built in the Data Link Properties dialog is entered in the Open Database dialog. |

| 9. | Click Connect to make the connection to the database. The connection is made and a dialog appears in which you select the required DB information. How to do this is described in the section DB Data Selection. |
See also:
DBs and StyleVision, for a description of how DBs work with StyleVision.
DB Data Selection, for a description of how to select tables or structures in the DB as the schema and data sources.
The DB Schema and DB XML files, for a description of the XML Schema and XML data files that are generated from the DB when it is loaded in StyleVision.
Connection Wizard, for information about connecting to a DB using StyleVision's Connection Wizard.
ODBC Connections, for information about connecting via ODBC.
Datatype Conversions: DB to XSD, for mappings of DB datatypes to XSD datatypes when the XML Schema is generated from the DB.
|