1 - AppxIO (our proprietary ISAM) or VAX/RMS. 2 - VISION (from AcuCobol) 3 - CISAM (from Informix) 4 - Sybase 5 - Oracle 6 - ODBC (for example, SQL-Server, Access, etc.) 7 - APPX/NET remote AppxIO file serverTo store a file in an ODBC Database, go into 5)Database File Management, 2)File Specifications, change the FMS Attribute from '1' to '6'. Then, establish the file's ODBC specifications by setting its 'FMS Group' Attribute to a valid FMS Group Name. The FMS Group is SCANable. You can create and edit File System (FMS) Groups from within this SCAN. (Look in the upper right hand corner of the screen.) Within the File Sstem Group's "1)FMS Controls" must be defined:
1) ODBC [[#System Data Source][Data Source Information]] (DSN), 2) [[#Table Names][Table Name mapping]] (table_name), and 3) [[#Row Locking][Row Locking]] (proxy_db)
DSN=local_sql_server; UID=sa; PWD=;: table_name=$lcase($appl_$file): proxy_db=LOK:The APPX/ODBC Connection interprets the above example as follows:
DSN=<data_source_name>: DSN=<data_source_name>; UID=<user_id>: DSN=<data_source_name>; UID=<user_id>; PWD=<password>:For example, to connect to an Access data source, you would provide ODBC with a specification such as:
DSN=Access-Accounting;:
To connect to an MS SQL-Server Database (which requires a user name and password) you might specify:
DSN=sql_server; UID=bobby; PWD=ybbob;:To connect as the SQL-Server administrator (with a blank password):
DSN=local_sql_server; UID=sa; PWD=;:
DSN=<expression>: - specifies ODBC Data Source table_name=<expression>: - specifies ODBC table name proxy_db=<expression>: - specifies proxy locking DatabaseNote that required colons terminate each <expression>. <expression> may use the following 'variables':
$db - maps to 3-character APPX Database ID $appl - maps to 3-character APPX application ID $version - maps to 2-character APPX version $file - maps to 8-character APPX file name $uid - maps to 3-character APPX user id $pid - maps to Unix process ID $uname - maps to Unix user name $ucase( <expression> ) - converts <expression> to upper-case $lcase( <expression> ) - converts <expression> to lower-caseYou can use these FMS control specifications to define a mapping algorithm for file names. For example:
table_name = $lcase( $appl_$file );... will cause us to convert APPX file names to lower-case and prepend the 3-character application ID and an underscore. (For example "TGL BALANCE1" will be converted to "tgl_balance1"). If your ODBC Data Source Name (DSN) contains multiple Databases, try opening the file from APPX. Data Sources that support multiple Databases will sometimes pop up an interactive box asking you which Database you wish to operate upon. The current release of APPX has a very picky FMS control parser. If your FMS control specifications are not syntactically correct, APPX will hang when you try to create a data file in that File System Group. Sorry.
Because most ODBC compliant Databases do not handle "intent" record locks, the APPX/ODBC Connection manages Row Locking external to the underlying Database. When you read a record (row) with Hold, APPX locks (by 'intent') that record for rewrite or deletion, preventing other APPX users from locking the record. To manage locking among multiple users, APPX uses its own 'proxy' Database. Define the following in your FMS Control specification:
proxy_db=<3-character Database ID>:
(note the ':' is required). For example:
proxy_db=LOK:
This tells APPX to use an APPX Database 'LOK' to build proxy locking files. This Database should not be the same as your operating database. It should be a name otherwise unused. 'LOK' is a good choice for a proxy database. Proxy locking files are located in directory:
$APPXPATH/<proxy_db_id>/<application>/Data/FILE.dat
The APPX/ODBC Connection will pick an ODBC data type for each field. APPX queries the Data Source for a list of supported data types and picks the most closely matched data type. Some APPX data types (such as partial time/date fields) are not supported by all ODBC data sources. In this case, APPX stores those fields in a character column.
To convert an existing AppxIO file into an ODBC Data Source, Export the file, change the file's FMS type from 1 to 6, and re-Import the file. To convert data stored in an ODBC Data Source back into AppxIO, Export it, change its FMS type from 6 back to 1 (AppxIO), and re-Import it.
APPX_DBG_CODE=0xFFFFFFFF must also be set to enable APPX_SQL_CMD logging. Go to Setting Environment Variables for information on how to set APPX_SQL_CMD and APPX_DBG_CODE.
WinSQL has an option to execute a text file containing SQL commands. So you can point it at an edited SQL_CMD log, and see how the SQL commands APPX sends to the Data Source behave under a 'thin' SQL client. Further, you can use it to massage table creation to manually set up the SQL table, if necessary (such as to modify APPX fieldnames that the ODBC Data Source might not like).
The APPX/ODBC Connection as of APPX releases 4.0.9 and higher has been tested and is supported using the Microsoft NT Server, and the MS SQL-Server and Access ODBC drivers. The ODBC/Excel interface is not fully functional, due to restrictions within the Excel/ODBC interface. Additional ODBC drivers will be tested as market conditions dictate. This version of the APPX/ODBC Connection will not restructure tables stored in all ODBC Databases. This version will restructure MS SQL-Server tables. The error reporting mechanism has not been completed. Typical errors such as "End of File", "File Not Found", and "Already On File" are handled properly. Unusual conditions such as "Out of Space" or "Connection Failure" are reported in a Windows dialog box. APPX/ODBC connection does not work in APPX 4.0.a. It works properly in 4.0.9, and the 4.1 releases and above
Importing a Database in SQL-Server format requires me to define the pathname in the optional path option of each file, when the Portdata directory is not at the standard place. It's not working when the pathname is defined in the File System Group.
==> The problem may be that your AppxIO files are stored in a non-standard path. When you export these AppxIO files to portable form, they also end up in the non-standard location.
When you then try to import them into SQL-Server, you are using a File System Group which does not point to the actual Portdata location.
When APPX tries to find your portable files, it is looking for AppxIO Portdata files (which have an FMS Type of '1') using the FMS Name that you provided for the import (say, SQLSERVER).
To get around this problem, define a File System Group with type='1', and a name of 'SQLSERVER' (or whatever your relational File System Group is called). Then specify the non-standard path in that type '1' FMS type.
For example, suppose the original AppxIO files were in the /AppxData/locn tree. Portdata exported files would be created in that tree.
The 2nd entry below would allow the Portdata files to be read from that tree when Importing into the ODBC files defined in File System Group 6/SQLSERVER:
-Opt- FMS Group FMS Path FC ============================== ==== ====================== ===== Original AppxIO file location 1 /AppxData/locn SQLSERVER 1 /AppxData/locn SQLSERVER 6 FC
1) The SysAdmin Database editor (which points to the FMS (File System) Groups), and
2) Individual files' "File Specifications" in Physical File (Database) Management.
It's possible to specify a default FMS-Control at the Database level. But it's not possible to specify a Database's default FMS-Number (ex: 5=Oracle, 6=SQL Server).
This is because it's not possible in "File Specifications" to leave the FMS (Number) blank. The individual files' FMS-Number therefore always overrides the FMS-Number specified in the FMS Group's FMS-Number. (ECR #2782)
When you are editing a database/application's "File Specifications", your edits are stored in System Administration's SYSDIR file. If you ever need to restore these edits from backup, this is the file from which to restore them.