Using Data SourcesData Source Basics, Operations, and PropertiesA Tango data source contains all the information needed to connect to a particular database. You use data sources to tell your Tango applications which databases to connect to. You use Tango Editor to create and manage data sources. Both Tango Editor and Tango Server need to have access to data sources. Tango Editor uses a data source--via the Data Sources Workspace--to show you the information in the form of tables and their columns. Tango Server requires the same data source, or a data source with the same name on the deployment machine, so it can access the database tables and columns specified within the application file.
The data source properties show the information about the data source, including information about its tables and columns. This chapter covers the following topics:
About Data Sources |
|||||||
Tango 2000 for Windows supports Pervasive.SQL, ODBC and Oracle data sources. |
DAM Data SourcesThe Data Access Manager (DAM) is a part of the Mac OS that allows DAM-aware applications to communicate with databases. Tango uses DAM to give you access to Butler SQL servers. You can also access Butler SQL servers using ODBC. Before creating a DAM data source, you must set up your Butler SQL server, create a database (using the ButlerTools application) and install it in the server's Public Databases folder. On the Tango Editor machine, you must have the ButlerLink Access database extension installed, and you must use the ButlerHosts application to create a host that connects to the Butler SQL server. Consult your Butler SQL documentation for more information. FileMaker Pro Data Sources
Tango lets you connect to FileMaker Pro databases through a local FileMaker Pro application (version 3.0 or later) running on the same machine as Tango, or on any Mac OS computer on the same AppleTalk network.
ODBC Data SourcesOpen Database Connectivity (ODBC) is a standard developed by Microsoft to allow applications like Tango to communicate with a wide variety of databases from different vendors. An ODBC client application talks to the ODBC driver manager that in turn talks to a database driver for a specific type of database. An ODBC driver is a kind of translator. It converts the standard ODBC requests made by the application into a format that can be understood by the target database system. ODBC drivers are available for accessing many database management systems (DBMS). Microsoft Access, Excel, Oracle, SQL Server, Informix, Sybase, and Butler SQL are some examples of databases that may be accessed through ODBC. |
||||||
The Tango installer installs ODBC drivers. See the Getting Started Guide for Macintosh for more information. |
Before creating an ODBC data source, you must set up your database server and create or install a database on this server. Depending on the database system, you may also need to install and configure additional software to allow you to connect to the server. Consult your database software and ODBC driver documentation for specific instructions. The ODBC system software is installed automatically with Tango, and you need an ODBC driver for the type of database you are connecting to. |
||||||
For more information, consult the documentation that accompanied your ODBC drivers. |
Some ODBC drivers are self-contained. The driver itself accesses and updates the database files. For these ODBC drivers, no other software is required.
Pervasive.SQL Data SourcesPervasive.SQL data sources are ODBC data sources and are treated separately in the Data Sources Workspace. For more information on ODBC, see the previous section. Oracle Data SourcesOracle is a high-performance client/server DBMS. To create and use Oracle data sources, you must have Oracle's SQL*Net installed. Tango supports SQL*Net versions 7.1 and 7.3. For more information, see the Getting Started Guide for Macintosh. The Data Sources WorkspaceYou perform most data source operations in the Data Sources Workspace (the Data Sources section of the Workspace). To display the Data Sources Workspace, click the Data Sources tab in the Workspace window. When you open the Data Sources Workspace, you see a folder for each type of data source that Tango supports.
Once a connection is made to a data source, the user name used for the connection appears in parentheses after the data source name. This avoids any confusion when different logins are being used for the same data source. Using Primary Key ColumnsA primary key column is a column (or combination of columns) whose value uniquely identifies each row in a table. For example, a customer number might be the primary key in a customers table. Primary key columns are identified in the Data Sources Workspace by the column/key icon. Tango builders rely on the primary key column values in various places to identify specific records. When using the builders, it is important to first check that the primary key for each table involved is set correctly. If the specified column or columns do not uniquely identify each record in a table, unexpected results can occur when executing the file. For example, if you mistakenly set the primary key column for a customer table to the "state" column (many customers likely share the same state), using the resulting file to delete a particular customer deletes all the customers in the same state. When connecting to a data source, Tango Editor queries the database for information to determine the primary keys. If there is no response, Tango determines the default primary keys by scanning each table for the first column with an appropriate data type (numeric or character). To change or add a primary key column
Data Source OperationsCreating a Data SourceDAMBefore creating a DAM data source for a local database, you must set up your Butler SQL server, create a database (using the ButlerTools application), and install it in the server's Public Databases folder. The ButlerLink Access database extension must be in the Extensions folder on your hard drive. Use the ButlerHosts application to create a host that connects to the local or networked Butler SQL server. To create a DAM data source |
||||||
For more information on setting up a Butler Host, consult your Butler documentation. |
FileMaker Pro
For Tango Editor to connect to a local FileMaker Pro data source, the database must be open already in FileMaker Pro, or there must be an alias of the database in the same folder as Tango Editor. For a network data source, the specified database and FileMaker Pro must be open on the machine networked to. To create a local FileMaker Pro data source |
||||||
For information on a networked FileMaker Pro data source, see "To create a networked FileMaker Pro data source". |
To create a networked FileMaker Pro data source |
||||||
For information on local FileMaker Pro data sources, see "To create a local FileMaker Pro data source". |
ODBC
Before you create an ODBC data source, make sure the required ODBC drivers are installed and your database server is running (or, for drivers that access local files, your database files are available). For a networked ODBC data source, make sure your ODBC drivers are installed. To create an ODBC data source
Pervasive.SQLBefore you create a Pervasive.SQL data source, you must install the required Pervasive.SQL ODBC driver on your machine, which can connect to a Pervasive.SQL database server running on the network.
To create a new Pervasive.SQL data source
Oracle |
||||||
For more information about Tango 2000 Oracle requirements, see the Getting Started Guide. |
Before creating an Oracle data source, make sure the correct Oracle client software is installed and the database server you want to connect to is available on the network. To create an Oracle data source
Modifying a Data SourceTo modify a data source
If a modified data source is already loaded, the data source is reloaded automatically using the new settings. Deleting a Data SourceTo delete a data source
Reloading a Data SourceIf the structure of your database changes while Tango Editor is open, you need to reload the data source. To reload a data sourceThe login information is as specified in the data source's login properties. Assigning Data Sources to ActionsTo assign a data source to an action, do one of the following: |
||||||
|
The Data Source Selection dialog box appears. Use this dialog box to set the data source for the action. The data source icon and data source name appear next to the assigned action.
|
||||||
For more information, see "Working With Data Source Properties". |
If Tango Editor has not yet connected to the data source, a login dialog box may appear. This dialog box only appears if you have the Ask each time option checked, which is the default, in the Development section of the Data Source Properties window.
If an action already has a data source assigned to it and you drag a column into it from a different data source, you are asked if you want to cancel the operation or to use the new data source instead.
If you use a new data source, Tango Editor scans the affected actions and updates the table owner information to match the new data source. Setting Up Deployment Data SourcesTango Editor allows you to specify deployment data source parameters that are different from development data source parameters; you can use meta tags in your application files to specify deployment data source parameters. Using deployment data sources, you can:
You can specify deployment data source parameters for each Tango action in an application file on a per-action basis; these can override the default data source settings.
The following sections describe how to set the parameters of a data source, and how to set deployment (or development) data sources for actions using the Set Data Source command. |
||||||
For more information, see "Disabling the Use of Meta Tags in Data Sources". |
Setting Deployment Data Source PropertiesYou can set deployment properties for data sources in the Deployment section of the Data Source Properties dialog box. This allows you to specify run-time data source parameters. To view the Deployment section of the Data Source Properties dialog box:
Deployment Data Source Parameters
Meta Tags and Deployment Data SourcesAll fields may contain meta tags, which are substituted when Tango Server executes the application file. When you control+click any text field, a contextual menu appears; it contains standard editing commands and the Insert Meta Tag... option. |
||||||
For more information, see "Inserting Meta Tags". |
Choose Insert Meta Tag... to open the Insert Meta Tag dialog box. You can insert many of the commonly-used Tango meta tags. |
||||||
For more information, see "Disabling the Use of Meta Tags in Data Sources". |
Before connecting to a data source, Tango checks the data source parameters for meta tags. If meta tags are found, and if the passThroughSwitch configuration variable is set to on, the substitution is performed, and the results are used to establish the connection. If no meta tags are found, the data source parameters are passed as-is. The following example shows a user name being obtained from the user variable username. The user password is taken from the file whose name corresponds to the user name, followed by the .pwd extension. Username: <@VAR NAME="username"> Password: <@INCLUDE FILE="<@VAR username>.pwd"> Setting Data Sources for ActionsYou can use the Set Data Source command to set development and deployment data source information independently for any selected actions. Using Set Data SourceTo set development and/or deployment data sources for one or more actions
Using the Action Properties Dialog BoxYou can also use the Deployment tab of the Action Properties dialog box to set data source parameters for actions. To view the Deployment section of the Action Properties dialog box
|
||||||
For more information, see "Setting Deployment Data Source Properties". |
Disabling the Use of Meta Tags in Data Sources
The passThroughSwitch configuration variable allows you to specify whether meta tags are substituted in data source parameters when Tango application files are executed on Tango Server. |
||||||
Passing through meta tags in deployment data sources is enabled in Tango by default. If you want to disable (or enable) this feature, you can do so by changing the options in the config.taf application file, in the Feature Switches screen: |
|||||||
Check or uncheck the checkbox beside the option. Working With Data Source PropertiesThe Properties dialog box allows you to view information about a selected data source, table, or column. In the Data Sources Workspace, control+click on one of these items and choose Properties from the contextual menu that appears.
The Data Source Properties dialog box contains three sections: General, Development, and Deployment. Click a tab to display the corresponding properties section.
Table PropertiesTable Properties shows the name, owner, and type of table. |
|||||||
Column PropertiesThe Column Properties window displays the name, title, data type, length, whether nulls are allowed or not, and whether the column is a primary key or not. |
|||||||
The Column Properties window allows you to edit the Title field and select the Primary Key option. The title is used by the builders as the default HTML display title for the column. The Primary Key option is used by the builders to create actions affecting a specific record (record detail display, update and delete). Connecting to Data SourcesWhen you expand a data source in the Data Sources Workspace you have not connected to, the login information specified in the Data Source Properties Development window is used for the connection. If you checked the Ask each time option, the Log In dialog box appears, allowing you to type your user name and password. Connecting to Large Data SourcesWhen Tango Editor connects to a data source containing more than 25 tables, it displays the Select Tables dialog box, allowing you to select which tables you want to work with. You can also open the Select Tables dialog box by doing one of the following:
Selecting TablesThe Available tables list in the Select Tables dialog box shows the tables in the data source. Drag the tables you want to work with from this list into the Tables to use list. If you no longer want to use one or more tables, drag them from the Tables to use list to the Available tables list. Filtering TablesYou can use the Owner and Type pop-up menus to filter the tables shown in the Available tables list of the Select Tables dialog box.
For example, to show only tables owned by a specific user, select that user from the Owner pop-up menu. To show only system tables, select SYSTEM TABLE from the Type pop-up menu. (The contents of these pop-up menus are determined by the data source; only owners and types existing in the database are listed.) Editing and Executing Files on Different ComputersWhen connecting to a data source, Tango relies on configuration information not included in the Tango application file itself. This becomes an issue when Tango Editor and Tango Server reside on different computers, and when editing a file created on a different computer. Tango cannot connect to the data source unless the computer is set up correctly. The following sections explain which pieces of data source information are stored in the file, which ones are not, and how to ensure a file works on a computer other than the one it was created on. ODBC Data SourcesFiles assigned ODBC data sources have these pieces of information stored in them: For the data source connection to be made on another computer, a data source with the same name pointing to the original database must exist. The user name and password must also be valid for the server pointed to by the data source. Oracle Data SourcesFiles assigned Oracle data sources have these pieces of information stored in them: If you specified a SQL connect string (such as T:199.230.9.8:ORCL) when defining the data source, your Tango file works on any computer the string points to that has access to the Oracle database server. This is because all the connection information is stored right in the string. If you specified an alias, an alias with the same name must exist on the computer on which you want to use the application file (aliases are created using the Oracle Easy Config application). The alias must point to the Oracle database used when the application file was created. FileMaker Pro Data SourcesApplication files assigned FileMaker Pro data sources have these pieces of information stored in them:
All of the information required to connect to a FileMaker data source is stored in the application file. You simply need to make sure the FileMaker application and database are available to the computer Tango is running on. For application files assigned data sources using the Any FileMaker application option, Tango looks for a FileMaker Pro application on the local computer and launches it if required. If the Named FileMaker application option is used, the FileMaker Pro application, or an alias of it, must be in the Tango Editor folder on your hard drive. |
|||||||
For more information, see "FMDatabaseDir" in the Meta Tags and Configuration Variables manual. |
In either case, the database must be open or located in the folder specified by the FMDatabaseDir configuration variable. |
||||||
For more information, see "FileMaker Pro Data Sources". |
For application files assigned data sources using the Networked FileMaker application option, the computer running Tango must be on the same AppleTalk network and have access to the specified remote computer. The database must be open in FileMaker Pro on the remote computer. |
Copyright © 1999, Pervasive Software. All rights reserved.