Before data can be converted to an ODBC Data Source, the DataFlex ODBC Driver must be loaded. This is best accomplished by creating a Managed Connection for the workspace. You can also load drivers using the Configure Database Drivers option from the Tools menu in the Studio.
Using the DataFlex ODBC Driver, you can connect to a variety of database systems. These systems all have their own rules on what constructions are legal and which data can be put into which column. Some database systems are more restrictive than DataFlex on the columns that can be placed in an index; others do not allow indexed columns to have an offset greater than the defined page size, and so forth. If a table contains a construction that is illegal in the target platform, the conversion will not succeed.
There is no way to determine up-front through ODBC if a construction is legal in the target database system. Knowledge about the target database system can avoid a lot of frustration in this area and save a lot of time. If an illegal construction is present, the only solution is to change the data definition so that it is acceptable by the target database system. Usually, when the data definition changes, the programs need to be adjusted too.
Next to illegal constructions, it is possible that certain columns have values that cannot be accepted by the target database. Many database systems do not accept two (2) digit year dates for example. If you have such dates in your original DataFlex files, the data needs to be adjusted before it can be converted.
Before you can convert anything to ODBC, you need to create an ODBC data source for your target database system. The data source must be created with the ODBC administrator program. Refer to the documentation of the driver you are using for specific details on how to setup a data source. Refer to Environment Setup Notes to see how some of the most popular database accessible through ODBC need to be set up.
There are two types of Data Sources, machine- and file Data Sources. Both types contain similar information, they differ in the way the information is stored. Because of these differences, they are used in a somewhat different manner.
Machine Data Sources are stored on the client system. Associated with the Data Source is all the information the ODBC Manager and database driver need to connect to the specified database. There are two Data Source subtypes, User- and System Data Sources. One specific user of the machine can use a User Data Source; all users that use the machine where the Data Source is defined can use a System Data Source.
File Data Sources are stored in a file with extension .dsn (in ASCII format). The file Data Source stores all the information the ODBC Manager and database driver need to connect to the specified database. The file can be manipulated like any other text file.
Starting in DataFlex 2021, the DataFlex SQL drivers may use 32 or 64-bit database client drivers but the DataFlex Studio always requires 64-bit database client drivers and DSN.
If using DSNs and compiling applications for 32-bit, make sure to have both a 32- and 64-bit version of the DSN (64-bit will be used by the Studio during development) and that the same name is used for both 32 and 64-bit versions of the DSN. Also make sure to have the correct architecture (32 or 64-bit) of database clients installed and available for the applications.
Existing databases may need to be converted to Unicode-capable databases.
Migrating Existing Workspaces to DataFlex 2021
Table Character Format in DataFlex