Advertising banner:

History
 
 AS20
Home • Help • A0 • Customization Tools • FCAS • AS20
 
FCAS and databases



Using FCAS with databases
FCAS applications can connect to any ODBC-compliant database (ODBC is the industry standard for relational database access). An FCAS form can tie into multiple database tables and multiple databases and the databases can be on different servers.
For fields that will always contain data from the same source (the same column in a database table), you can create bound columns database applications. This type of application ties fields to the appropriate database columns, providing a simple point-and-click interface that makes database information quickly accessible to users.
For more flexibility, when you do not have fields that are bound to a particular data source, you can use nonbound database access. Examples of uses for nonbound database access are:
•       forms with fields that can contain data from various sources, such as search results forms
•       applications that don't use forms to display data, such as an application that generates FirstClass scripting script.
To create a database application, you must create forms to search or display the data, then use SQL to find the data you want to display. You call SQL from your FCAS application source code. FCAS allows you to use BASIC code to manipulate the data and determine the look of the interface, and access FirstClass features such as security and permissions.
FCAS handles the ODBC connection, so all you have to do is set up one Data Source Name (DSN) on your server, and you can then write programs that access that database from any location.
Because you have access to FirstClass, you can also tie into a database to create users on FirstClass or change permissions or access levels inside the FirstClass system.



Data types and databases
Both FCAS and databases require that all data contained in their data structures have explicit data types.
If your application will be connecting to a database, you must be sure to use data types that are compatible with the corresponding database data types. These are the FCAS counterparts for common ODBC database data types:


FCAS
ODBC database
Integer
integer, int, smallint, tinyint, boolean, bit, yes/no
Long
integer, int, smallint, tinyint, boolean, bit, yes/no
Single
float, double, single, double precision, decimal, numeric
Double
float, double, single, double precision, decimal, numeric
Currency
monetary, money, currency, smallmoney
String
char, character, varchar, variable character, text, memo
Date
date, time, date/time, datetime, smalldatetime




Creating ODBC data sources
Before an FCAS application can connect to an ODBC-compliant database, you must use Windows to create an ODBC data source.
To do this:
1       Open ODBC in the Windows Control Panel.
2       Click Add on the ODBC Data Source Administrator's System DSN tab.
3       Select the ODBC driver for your database.
4       Click Finish.
5       Fill in the fields to set up the driver.
For help, use Windows' online help or see the driver manufacturer's documentation.
7202010_20004_0.png        Note
You need only connect to your ODBC database source once for all applications.
If you want to test the data source, you can connect to it with an ODBC client such as Microsoft Query, Microsoft Access, or Microsoft Excel.



Database connections
Adding database connections
To add a database connection:
1       Click New on the Connection tab of the Project Manager.
2       Fill in the connection information on the New Connection form.
Updating database connections
To update a database connection:
1       Select the connection on the Connection tab of the Project Manager.
2       Click Modify.
3       Change information as required on the Connection form.
Removing database connections
When you remove a database connection from a project, all tables associated with it are also removed. You cannot undo this operation.
To remove a database connection:
1       Select the connection on the Connection tab of the Project Manager.
2       Click Remove.



Database table connections
Adding database table connections
Before you can add a connection to a table in a database, you must add a connection to the database as a whole.
To add a connection to a table in a database:
1       Click New on the Table tab of the Project Manager.
2       Fill in the table information on the New Table form.
Updating database table connections
To update database table connections:
1       Select the table on the Table tab of the Project Manager.
2       Click Modify.
3       Change information as required on the Table form.
Removing database table connections
When you remove a database table connection from a project, all associations to that table in the project's forms are also removed. You can't undo this operation.
To remove a connection to a table in a database:
1       Select the table on the Table tab of the Project Manager.
2       Click Remove.



About ODBC error messages
FCAS uses standard ODBC error messages. Definitions of these error messages can be found in any Microsoft documentation dealing with ODBC, or on ODBC websites. These error messages will vary depending on the manufacturer of your ODBC driver.
[Link]Top