CategoryDataBases CategoryHowTo
Originally posted by Steve Blank
Pervasive and ODBC
There are several ways that one could go about this including simply copying a table definition and changing the database from "Btrieve" to "Pervasive" (or vice-versa). But the copying approach won't work without at least some manual tweaking. Briefly, here's the procedure I believe requires the least amount of work:
1. Create
Create the table definitions initially in the "Btrieve" database.
1.1) Be sure to respect ODBC API requirements for table and column naming conventions, specifically:
1.1.1) Table and column names cannot be longer than twenty characters, must begin with a letter of the alphabet (A-Z, a-z), and can only contain letters (A-Z, a-z), digits (0-9) and the underscore character (_).
1.1.2) Table names must be unique within the database; no two tables within the same database can be named the same. Likewise, column names must be unique within the table; no two columns within a table can be named the same. Table and column names are NOT case-sensitive.
1.2) Observe ODBC restrictions on data types, specifically:
1.2.1) Alpha-type columns cannot be longer than 255 characters.
1.2.2) No table can contain more than one Memo/BLOB-type column.
1.3) Certain column types will require that you manually change their Stored As properties from those Magic assigns by default, specifically:
1.3.1) Logical columns will need to be changed to Stored As: Integer
Logical, Size: 1.
1.3.2) Date columns will need to be changed to Stored As: YYMD Date.
1.3.3) Time columns will need to be changed to Stored As: HMSH Time.
1.4) Make sure to change columns' Modifiable property from the default "yes" to the overridden "yes" (or to "no" if needed). For more information on this quirk, see the NOTE under Step 6 in following message in the here:
PervasiveDDF
2. Magic
Use Magic to create the underlying, physical data files via these "Btrieve" table definitions -- Ctrl+G is good enough. Do not use Magic to create data files via the "Pervasive" database.
3. Pervasive Control Center
Use the Pervasive Control Center's Create New Database wizard to create the "Pervasive" database on the server. This wizard creates the Named Database, the Engine DSN and a fresh set of empty DDFs.
4. DDF Utility
Use Magic's DDF Make utility to populate the new, empty DDFs.
NOTE:
For details on steps 3 and 4, refer to the following here:
PervasiveDDF
5. Database Wizard
Run the Pervasive Control Center's Check Database wizard; do not proceed until all tables pass the wizard with no failures.
6. Get Definition
Use Magic's Get Definition utility to create table definitions in the Table Repository for the "Pervasive" database. In my experience, the only problem you might encounter with these table definitions will be with those Btrieve tables that contain Memo columns: Magic's Get Definition utility will create these columns without a Picture. The solution is to manually enter the same Picture as you defined in the table's "Btrieve" counterpart -- everything else should be okay as is.
There are no comments on this page. [Add comment]