How to connect to Pervasive files with ODBC?

164 Views Asked by At

I'm on Azure and I would like to access a Pervasive database with PHP ODBC. I've got the information from mirtheil that there has to be a so called engine installed as well in order to be able to access the database. I've checked the installed apps where I've found a zen control center (or zen monitor) where I can see an engine, but it's very strange. There are 3 default databases defined (I can access these with ODBC), but these seem like nothing to have to do with the data im looking for. Now as I understand, the Pervasive database is no database like an RDBMS but a bunch of text files. I can see some of these that are actually in use. Under active files it says 400+ active microkernel files. I think these are the ones I need. Now how do access these with ODBC? Could you please pont me to the right direction?

1

There are 1 best solutions below

8
mirtheil On

To access data through ODBC, a Database must be created. When creating the database, you will point the database to the DDF files (FILE.DDF, FIELD.DDF, and INDEX.DDF at a minimum) and the Data files. The definition of the database name is:

A named database (also called a DBname) is a database with a logical name that allows users to identify it without knowing its location. Zen requires that all databases be named. When you name a database, you associate that name with a particular dictionary directory path and one or more data file paths. A named database is connected to through various access methods. For ODBC access, for example, you must set up a data source name (DSN) to refer to the named database. Multiple DSNs may point to the same named database. See ODBC Database Access in ODBC Guide. For other access methods, application developers can connect to a named database using the API for that access method. Refer to the developer reference guides in the Zen documentation.

as documented at https://docs.actian.com/zen/v15/index.html#page/advops/creatingdb.htm#ww69486 Creating a Database can be done using the following steps:

  1. In Zen Explorer, right-click the database engine where you want the new database and select New > Database. In the Create New Database dialog box, provide a database name and location (see Identifier Restrictions).
  2. The name cannot match an existing DSN. Also, no two data files in a directory can share a file name and differ only by file name extension. For example, invoice.btr and invoice.mkd are not allowed in the same directory because the database engine ignores the extension and sees them as the same file.
  3. Set database and DSN options. See New Database GUI Reference for information about the options.

The data files are not text files. There is an individual file for each table. Those files can be access using ODBC (or other relational methods) or through the Btrieve (or other Transactional methods) interface.