btrieve Vo2Btrieve is a Class Library for Visual Objects that gives VO developers a very fast and direct interface to data stored in Btrieve tables and table based access to data in Pervasive SQL databases.
  Buy Now  FAQ
   Download  Docs

Vo2Btrieve - FAQ

  1. How does Vo2Btrieve handle Btrieve file structures?
  2. Can Vo2Btrieve handle files with different record layouts in one file?
  3. What versions of Btrieve/Pervasive SQL does Vo2Btrieve support?

How does Vo2Btrieve handle Btrieve file structures?

Unlike DBF files, Btrieve files don't contain structure information. That means that a program using these files must know the structure of the file to be able to read information in that file. In time 3 different ways to handle this have developed:

  1. The program stores the structure in code.
  2. The program stores the structure in a structure file that accompanies the data file
  3. The program uses a dictionary to store the structure of all the datafiles

Vo2Btrieve supports all three ways to define the data file structure:

  1. You can specify the structure using a string that contains the field names & types.
  2. Vo2Btrieve supports the popular RQB format that was introduced by the Clipper add-on library RaSQL/B.
  3. Vo2Btrieve full supports the popular DDF dictionary format, that is also used by Pervasive SQL to store table structures

If you want to store your structure in another format, you can still use Vo2Btrieve, and create a subclass from the Btserver class that handles this format and translates it into the string format that was mentioned under a.

Can Vo2Btrieve handle files with different record layouts in one file?

When you open a Btrieve file with Vo2Btrieve you must specify one layout using any of the techniques mentioned above. This is called the default structure. In addition to that you can an unlimited number of alternate structures using the AddStructure method of the Server class.

When running your application you can now switch between structures as needed by calling the SetStructure method of the server.

Of course you should be VERY CAREFUL with this feature if you have used the server in combination with VO's DataWindow and/or Databrowser classes. The DataWindow and Databrowser classes store information about the server they are connected to internally, and they may get confused by the new structure, especially if they are linked to a field that is not available anymore in the new structure.

        oSrvr := BtDDFServer{.....}
        aFlds := Bt_ReadDDFieldInfo(....)
        oSrv:AddStruct(#Alternative,aFlds)
        oDw:Use(oSrv)
        oDw:ViewTable()
        oDw:Show()
        // now operate on the alternative layout
        // to be safe we disable notifications
        oSrv:SuspendNotification()
        symStruct := oSrv:CurrStruct
        oSrv:SetStruct(#Alternative)
        ..
        ..
        // Switch back to the previous layout
        // and enable notifications
        oSrv:SetStruct(symStruct)
        oSrv:ResetNotification()
    

What versions of Btrieve/Pervasive SQL does Vo2Btrieve support?

Vo2Btrieve supports all version of Btrieve from version 6.15 and higher, that means Pervasive SQL 7 and Pervasive SQL 2000 are also supported.