Announcement

Collapse
No announcement yet.

Btrieve - P.SQL notes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Btrieve - P.SQL notes

    From time to time, I see questions come up about using Btrieve
    (AKA Pervasive.SQL) with 32-bit compilers. Here are a few
    notes:

    (1) The 32-bit interface DLL is WBTRV32.DLL, *NOT* WBTRCALL.DLL .
    In P.SQL, it's different yet, but a WBTRV32.DLL is still supplied
    that calls the 'real' interface DLL's. So, yes, you can write an
    interface that will work with Btrieve 6.X forward to P.SQL 2000.

    (2) Since Btrieve uses binary (string o' bits) records, if you
    use structures, (TYPEs) BYTE alignment is required. (Bad news
    for VB4/5/6 folks, but there are ways to handle it)

    (3) Contrary to popular belief, current server-based versions of
    Btrieve (P.SQL) on NT and Netware are very fast, very robust, and
    YES, it's worth the headache of building or buying a good interface.
    The packet overhead for Btrieve is only a small fraction of that of
    MS SQL, as is the "weight" of the server engine. You can use ISAM
    and/or SQL access methods concurrently and transparently.

    (4) A good, lightweight (Win32) tool that handles DDF (Btrieve data dictionary) and data files is "DDF Editor", written by Radiy Belov,
    and available from http://bsl.com.ru/ddf_edit.htm . It's $29 to
    register, a "steal".

    (5) The -easiest- way to access 32-bit Btrieve files from VB4/5/6
    is to use the ActiveX tools provided in the P.SQL SDK . There seems
    to be considerable resistance to this for some reason. Since back
    when Steve Mook (Smithware at the time) wrote them, I've lobbied
    where I could to keep 'em as small and fast as possible. Although
    I no longer have any direct connections with Pervasive, the latest
    versions seem to be just fine.

    (6) If you absolutely can or will not use the SDK tools, there are
    other ways. For example, using a BYTE array for the data record,
    and a function DLL to 'get' and 'put' variables of different data
    types. Although I don't currently have anything written in PB,
    I'll be happy to email the Visual C source for such a DLL to anyone
    that wants it. It's cheap, dirty, and extremely fast. Unfortunately,
    I don't have a lot of time to help with building interfaces, but
    if one individual wanted to build the 'definitive' Btrieve interface,
    I'll certainly help where I can with code and support.

    Regards,
    Jim Barber

  • #2
    If anyone needs an interface to btrieve, I have one downloadable from my website. The calls are encapsulated - instead of the one big hairy btrieve call, I've broken them out into a handful of easier calls. E.g.
    wrbtOpen(databasename$, options) - returns a handle to a database
    wrbtClose(handle)
    wrbtSetKey(handle) sets the index sort order
    wrbt(handle, btrvOperation%, structure) is the btrieve call. It creates a key buffer from the provided structure (used in all B_GET_xxxx operations) and it fills the structure with the requested record.
    wrbtPos(handle) returns the position of the current record
    wrbtDirect(handle, position, structure) - retrieves a record based on its position.
    Also, I have a set of calls to retrieve fields on an individual basis from the .ddf files.

    There are a few more too (to retrieve a record count, percentage, etc)

    The source code is available for the asking - just send me an email. There are compiled 32-bit (calls wbtrv32.dll) and 16-bit (calls wbtrcall.dll) available for download from my web-site: www.basicguru.com/dickinson

    Per Pervasive itself, Version 7+ (aka P.SQL or SQL 2000) have been very stable and fast. I have to say that the previous windows versions were not as stable. Btrieve pre-7 seems to be "hyper-sensative" to various network card and network oddities. Not to mention the problems with version conflicts - for instance - all btrieve programs with 6.x btrieve have to share one copy of BTI.INI - this has been a big problem for us. The only problem I have with P.SQL 7 is that you HAVE to go client-server if you need multi-user sharing. I understand why they did it, but it's a real pain for us. With v6.15 we could send out a demo of our software that could be used by more than one user simultaneously. We can't do that w/ version 7+ because in order to have multiple users, you have to buy the server engine (or workgroup server).
    Best Regards,
    Don
    Don Dickinson
    www.greatwebdivide.com

    Comment

    Working...
    X