b_SIMPLE

This is a simple wrapper 32 bit unit for BTRIEVE file operations. B_SIMPLE bypasses ODBC, is not a bound control and does not require DDF's. The call to b_SIMPLE requires only two parameters. B_Simple does require the file 'WBTRV32.DLL'.

Instructions for b_SIMPLE

A. File Declarations
For each BTRIEVE file your application uses, the file structure as defined needs to be defined in a DELPHI unit. Preferably, each BTRIEVE file will have its own unit. In this unit you declare the number of keys for the BTRIEVE file, the internal structure for the file, the key structure and define several other components of the b_Simple object. Listed below is an example of such a declaration for a sample BTRIEVE file.

(*=======================================================================*)

Unit CompBTR;

INTERFACE

uses B_Smple;  {Please NOTE that each file will have this USES statement }

CONST
   Comp_Max_key      =  1;    {Maximum number of defined keys for file }

TYPE
  Comp_Rec = record
  case integer of
  1 : (
          Code 	 : String[5];
          Name     	 : String[25];
          Address1	 : String[25];
          City   	 : String[20];
          State   	 : String[2];
         Zip     	 : String[10];
         Contact 	 : String[25]);
  2 : (Rec_Posn  : String[4]);
  3 : ( Start    : Integer);
  end;

  Comp_Key_Buf_0 = record
    code      : String[5];
  end;

{If there were more keys, then there would be declaration for each key
ie
Comp_Key_Buf_1 = record
  Name	: String[25];
end;
}

VAR
  Comp            	: Comp_Rec;
  CompB          	: b_Simple_Rec;
  Comp_Key_0   : Comp_Key_Buf_0;
{Comp_Key_1	: Comp_Key_Buf_1; }

PROCEDURE CompProc;

IMPLEMENTATION

PROCEDURE CompProc;
   Begin
     CompB.FName  	:= 'Company.btr ';      { File Name }
     CompB.Path_Buf  	:= 'c:\test '; 	       { File Path }
     CompB.len  	  	:= SizeOf(Comp);       { Record length }
     CompB.RecPtr 	:= @Comp;                 { Data record pointer  }
     CompB.CurKey	:= 0;                             { Set Current Key to primary key }
     CompB.KeyCnt 	:= Comp_max_key;   { Maximum number of keys defined for file}
     CompB.key[0] 	:= @Comp_Key_0;   { Key  record pointers }
{     CompB.key[1] 	:= @Comp_Key_1;   }
   End;

end.

(*========================================================================*)


B. b_SIMPLE / Btrieve Operations

Listed below are declared constants in the b_SMPLE unit. Please refer to your
BTRIEVE manual for complete details.


(* ============================ BTRIEVE OPERATIONS ==================== *)
(* =================================================================== *)

  B_Open        	=  0;
  B_Close       	=  1;
  B_Insert      	=  2;
  B_Update      	=  3;
  B_Delete      	=  4;
  B_Get_EQ      =  5;
  B_Get_Next    =  6;
  B_Get_Prev    =  7;
  B_Get_GT      	=  8;
  B_Get_GE      	=  9;
  B_Get_LT      	= 10;
  B_Get_LE      	= 11;
  B_Get_First   	= 12;
  B_Get_Last    = 13;
  B_Create      	= 14;
  B_Stat        	= 15;
  B_Extend      	= 16;
  B_Set_Dir     	= 17;
  B_Get_Dir     	= 18;
  B_Beg_Tran    = 19;
  B_End_Tran    = 20;
  B_Abo_Tran   	= 21;
  B_Get_Pos     = 22;
  B_Get_Direct  = 23;
  B_Step_Dir    	= 24;
  B_Step_Next   = 24; 
  B_Stop        	= 25;
  B_Version     	= 26;
  B_Unlock      	= 27;
  B_Reset       	= 28;
  B_Set_Own     = 29;
  B_Clr_Own     	= 30;
  B_Crt_SI      	= 31;
  B_Drp_SI      	= 32;
  B_Step_First 	= 33;
  B_Step_Last   = 34;
  B_Step_Prev   = 35;

  B_Get_Keys    = 50;
  No_Lock       	=  0;
  B_Lock_WS   = 100;
  B_Lock_NS    = 200;
  B_Lock_WM   = 300;
  B_Lock_NM    = 400;

C. Results of b_Simple Call

After a call is made to the b_simple object, the success/failure is stored in the object's status. In the example listed above, one would check the value of Compb.Status after a b_Simple operation. There is an object that will display the resulting error message in a standard message box by making a call to b_Simple_Rec.bDisplay_err(b_Simple_Rec.status) ie Compb.bDisplay_err(Comb.status);

Listed below are the associated error messages with the status code.

(* =========================== BTRIEVE ERROR CODES ====================== *)
(* ====================================================================== *)

  Operation_OK         	=  0;
  Invalid_Operation    	=  1;
  I_O_Err              	=  2;
  No_Open              	=  3;
  Key_Not_Found        	=  4;
  Duplicates_Err       	=  5;
  Invalid_Key_Err      	=  6;
  Different_Key_No     	=  7;
  Invalid_Position     	=  8;
  Eof_Err              	=  9;
  Modifiable_Err       	= 10;
  Inv_File_Name        	= 11;
  File_Not_Found       	= 12;
  Extension_Err       	= 13;
  Pre_Open_Err         	= 14;
  Pre_Image_Err        	= 15;
  Expansion_Err        	= 16;
  Close_Err            	= 17;
  Disk_Full            	= 18;
  Unrecoverable_Err    	= 19;
  Record_Manager_IN     = 20;
  Key_Buffer_Err       	= 21;
  Record_Buffer_Err    	= 22;
  Position_Block_Err   	= 23;
  Page_Size_Err        	= 24;
  Create_IO_Err        	= 25;
  Number_of_Keys_Err   = 26;
  Key_Position_Err     	= 27;
  Record_Length_Err    	= 28;
  Key_Length_Err       	= 29;
  File_Name_Error      	= 30;
  Extend_Err           	= 31;
  Extend_IO_Err        	= 32;
  Extend_Name_Err      	= 34;
  Directory_Err        	= 35;
  Transaction_Err      	= 36;
  Begin_Tran_Err       	= 37;
  Tran_Control_File    	= 38;
  End_Abort_Err        	= 39;
  Tran_Max_File_Err    	= 40;
  Tran_Oper_Err        	= 41;
  Incompl_Accel_Err    	= 42;
  Invalid_Data_Access  	= 43;
  Null_Key_Path        	= 44;
  Inconsis_Key_Flags   	= 45;
  Access_Denied        	= 46;
  Max_Open_Files       	= 47;
  Invalid_Alt_Seq_Def  	= 48;
  Key_Type_Err         	= 49;
  Owner_Already_Set    	= 50;
  Invalid_Owner        	= 51;
  Error_Writing_Cache  	= 52;
  Invalid_Interface    	= 53;
  Variable_Page_Err    	= 54;
  Incomplete_Index     	= 56;
  Conflict_Err         	= 80;
  Lock_Err             	= 81;
  Lost_Position        	= 82;
  Read_Outside_Tran    	= 83;
  Record_In_Use        	= 84;
  File_In_Use          	= 85;
  File_Full            	= 86;
  Handle_Full          	= 87;
  Mode_Err             	= 88;
  Device_Full_Err      	= 90;
  Server_Err           	= 91;
  Transaction_Full     	= 92;
  Incompat_Lock_Type   = 93;
  Permission_Err       	= 94;
  Session_Not_Valid    	= 95;
  Comm_Envirnment_Err  = 96;
  Data_Message_Small   = 97;
  Internal_Tran_Err    	= 98;

  Update_Changed       = 999; { added to indicate image changed during update }

(* ========================== BTRIEVE OPEN OPTIONS ===================== *)
(* ==================================================================== *)

  Normal        	=  0;
  Accelerated   	= -1;
  Read_Only     	= -2;
  Verify        	= -3;
  Exclusive     	= -4;

  Soft_Errors = [Operation_Ok, Eof_Err, Key_Not_Found];
  Busy_Errors = [File_In_Use, Record_In_Use];



HARDWARE / SOFTWARE NOTES

There are two parameters to call the b_simple object. The first parameter is the type of file operation ie B_open, B_Get_first, etc. The second parameter depends upon the type of file operation. If the operation is B_Open, the second parameter is the type of file open. If the type of operation is related to a key, then the second parameter is the key number (0 to the maximum number of keys for the file). 

The software is designed to run under the Microsoft WINDOWS TM  95/98/NT 4.0 operating systems. BTRIEVE is a copyrighted product by PERVASIVE TECHNOLOGIES. ALL RIGHTS RESERVED.
 

REGISTRATION SAMPLE FILES

The registered version comes in file in a compressed format.  Distribution is done via email. 
The registration reminder screen in the unregistered version is not displayed in the registered version.

The b_Simple software is  copyrighted (c) 1995-1999. ALL RIGHTS RESERVED.


SOFTWARE SUPPORT POLICY

There is three months of free support from the date that the product is registered. Support is by mail to the address below,  email at paul@lurix.com, or by telephone at (281) 346-1607 from 9am - 5pm CST Monday through Friday.


DEFINITION OF SHAREWARE

Shareware distribution gives users a chance to try software before buying it. If you try a Shareware program and continue using it, you are expected to register. Individual programs differ on details -- some request registration while others require it, some specify a maximum trial period. With registration, you get anything from the simple right to continue using the software to an updated program with printed manual.

Copyright laws apply to both Shareware and commercial software, and the copyright holder retains all rights, with a few specific exceptions as stated below. Shareware authors are accomplished programmers, just like commercial authors, and the programs are of comparable quality. (In both cases, there are good programs and bad ones!) The main difference is in the method of distribution. The author specifically grants the right to copy and distribute the software, either to all and sundry or to a specific group. For example, some authors require written
permission before a commercial disk vendor may copy their Shareware.

Shareware is a distribution method, not a type of software. You should find software that suits your needs and pocketbook, whether it's commercial or Shareware. The Shareware system makes fitting your needs easier, because you can try before you buy. And because the overhead is low, prices are low also. Shareware has the ultimate money-back guarantee -- if you don't use the product, you don't pay for it.


DISCLAIMER - AGREEMENT

Users of b_Simple must accept this disclaimer of warranty: "b_Simple is supplied as is.  The author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose.
The author assumes no liability for damages, direct or consequential, which may result from the use of b_Simple"

B_Simple is a "shareware program" and is provided at no charge to the user for evaluation.  Feel free to share it with your friends, but please do not give it away altered or as part of another system.  The essence of "user-supported" software is to provide personal computer users with quality software without high prices, and yet to provide incentive for programmers to continue to develop new products.  If you find this program enjoyable and are anxious to find out the conclusion of  B_Simple  after a reasonable trial period, you must make a registration payment of $ 25.00 to Lurix Corporation.  The $ 25.00 registration fee will license one copy for use on any one computer at any one time.  You must treat this software just like a book.  An example is that this software may be used by any
number of people and may be freely moved from one computer location to another, so long as there is no possibility of it being used at one location while it's being used at another.
Just as a book cannot be read by two different persons at the same time.

Commercial users of B_Simple must register and pay for their copies of B_Simple within 30 days of first use or their license is withdrawn.  Site-License arrangements may be made by contacting Lurix Corporation.

Anyone distributing B_Simple for any kind of remuneration must first contact Lurix Corporation at the address below for authorization. This authorization will be automatically granted to distributors recognized by the (ASP) as adhering to its guidelines for
shareware distributors, and such distributors may begin offering B_Simple immediately (However Lurix Corporation must still be advised so that the distributor can be kept up-to-date with the latest version of B_Simple.).

You are encouraged to pass a copy of B_Simple along to your friends for evaluation.  Please encourage them to register their copy if they find that they can use it.  All registered users will receive a copy of the latest version of the B_Simple


OMBUDSMAN STATEMENT

This program is produced by Paul Lurix, a member of the Association of Shareware Professionals (ASP).  ASP wants to make sure that the shareware principle works for you. If you are unable to resolve a shareware-related problem with an ASP member by contacting the member directly, ASP may be able to help. The ASP Ombudsman can help you resolve a dispute or problem with an ASP member, but does not provide technical support for members' products.  Please write to the ASP Ombudsman at 545 Grover Road, Muskegon, MI USA 49442-9427, Fax  616-788-2765, or send a CompuServe message via CompuServe Mail to ASP
Ombudsman 70007,3536.


CONTACTING US

			LURIX CORPORATION
			P.O. Box 148
			Fulshear, TX 77441

			(281) 346-1607
			Email          : paul@lurix.com
			Paul Lurix

