home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
lan
/
btrv
/
btrv.txt
< prev
next >
Wrap
Text File
|
1992-06-06
|
46KB
|
1,141 lines
Introduction
BTRV copyright (C) 1992 by Richard W. Hansen, all rights reserved.
Btrieve and Butil are a copyrighted by Novell, Inc.
BTRV is a utility program for maintaining and creating files using the
Btrieve record manager from Novell,Inc. BTRV was created primarily as an
aid for programmers developing Btrieve applications, but can be
invaluable to anyone who uses or maintains Btrieve files.
Some of BTRV's features are:
* Easy file creation.
* Supports all key and file types.
* Supports variable length records.
* Browse and edit files.
* Clone files.
* Recover damaged file.
* Load and Save files in Butil format.
* Calculate optimum page sizes.
* Test record locking and transaction processing.
* View file statistics.
* Get record positon/Read record by position
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
Users of BTRV must accept this disclaimer of warranty: "BTRV 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,
1
direct or consequential, which may result from the use of BTRV."
License Agreement
BTRV is a "Shareware program" and is provided at no charge to the user
for evaluation. Feel free to share, but please do not give it away
altered or as part of another system. If you find this program useful
and find that you are using BTRV and continue to use BTRV after a
reasonable trial period, you must make a registration payment of $50.00
to Richard Hansen. The $50.00 registration fee will license one copy for
use on any one computer at any one time, site licenses are available.
You must treat this software just like a book. Each licensed copy may be
used by only one person at a time, just as a book cannot be read by two
different persons at the same time.
Commercial users of BTRV must register and pay for their copies of BTRV
within 30 days of first use or their license is withdrawn. Site license
arrangements may be made by contacting Richard Hansen.
Anyone distributing BTRV for any kind of remuneration must first contact
Richard Hansen for authorization.
How to Register and Get Help
To register, fill out a registration form and send $50.00 U.S. (non U.S.
registrations add $10.00) for each copy being registered. For your
registration you will receive the latest version and complete printed
documentation. If you have any suggestions, problems, or questions please
contact me.
Richard Hansen
PO Box 18571
St. Paul MN 55118-0571 USA
On the CompuServe Information Service at User ID :
70242,3367
Installation
The file "BTRV.EXE" is the only one you need. BTRV will create its
configuration file, "BTRV.CFG", in the same directory as the BTRV
program.
Requirements
BTRV requires DOS 3.0 or greater and a minimum of 256K bytes of memory
plus the memory your configuration of Btrieve needs. BTRV will run on
any monochrome or color monitor. Since BTRV uses a text based windowing
and pull down menu environment, use of a mouse is strongly recommended.
BTRV should work with any version of Novell's Btrieve, and supports most
functions through version 5.10. It supports all file, record, and key
types; including data only files and variable length records. You may
create files with up to 24 segments, and can view files by any defined
index path.
2
Getting Started
This documentation is not intended as a tutorial on Btrieve, that is a
subject of it's own. I hope that this documentation will serve as a
thorough instruction in BTRV and its uses.
To start the program, you must first load Btrieve. A batch file, that
loads the Btrieve Record manager and then BTRV, is the most convenient
method. To ensure that you can open any file, it is best to start
Btrieve with a page size of the maximum 4096 bytes.
If you want a file opened automatically, you can enter a path and
filename on the command line. If you don't load a file from the command
line, choose the Open option from the File menu. Type in a path and
filename or use the Tab key to move to the file list box and choose a
file. When you have typed in a filename or highlighted one in the list
box, press Enter or click on the Open button with the mouse.
Once you have opened a file, pull down the View menu. From the View menu
you can view various aspects of the current file. You may check the file
statistics, view the data in the file records, or view the key buffer
for the current record. In addition, you can browse through a window
that displays the key fields defined for each record in the file.
Basics for Using BTRV
When you start BTRV you will see a screen like the one below. At the top
is the menu bar. At the right end of the menu bar is a clock that
displays the current system time. To the left of the clock is a display
of the free bytes of system memory. At the bottom of the screen is a
status line that displays a few of the most commonly used hot key
combinations. Between the menu bar and the status line is the desktop.
The desktop is where all windows and dialog boxes will be opened and
displayed.
All program functions are accessed from the main program menu. In
addition, many functions have hot key combinations (see Appendix A) that
can be used to invoke them. If you have a mouse, there are several
functions available by clicking the mouse in the status line at the
bottom of the screen.
A mouse is the easiest way to operate the program. Any option or program
operation, except those that require character entry, such as file owner
name, can be executed with a mouse. If you are familiar with Microsoft
Windows, you should have no difficulty using BTRV with a mouse.
If you are using the keyboard, pressing F10 will move you to the menu
bar. You can also type Alt and the first letter of the desired menu bar
option, such as Alt-V for the View menu or Alt-F for the File menu. To
Exit the program you can press Alt-X, select Exit from the File menu, or
click the mouse on "Alt-X Exit" in the status line.
3
┌──────────────────────────────────────────────────────────────────────────┐
│ File Input Output View Locks Window Misc 321232 09:18p│
│ ┌─────────────────┐ │
│ │ Open... Ctrl-O │ │
│ │ Create... │ │
│ │ Clone... │ │
│ │ Recover... │ │
│ │ Load... │ │
│ │ Save... │ │
│ │ Close Ctrl-C │ │
│ ├─────────────────┤ │
│ │ Set Owner │ │
│ │ Clear Owner │ │
│ ├─────────────────┤ │
│ │ Unload Btrieve │ │
│ │ Reset Btrieve │ │
│ │ Exit Alt-X │ │
│ └─────────────────┘ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│Alt-X Exit Ctrl-Home First Ctrl-End Last Ctrl-N Next Ctrl-P Prev │
└──────────────────────────────────────────────────────────────────────────┘
Figure 1 - BTRV opening screen
Dialog Boxes
BTRV receives user input in dialog boxes. Only one dialog box may be
open at a time. When you open a dialog box, one of the buttons will be
highlighted in some manner, depending on your color setup. This button
is the default and will be executed if you press Enter. Enter does not
move from field to field, use Tab and Shift-Tab or the mouse for that.
Every dialog box has an OK button (or some equivalent such as Open) and
a Cancel button. You can back out of any operation, from almost any
point, by pressing Escape or selecting the Cancel button. When you press
Enter, with the OK button as the default or highlighted button, whatever
data you have in the dialog box will be used.
Dialog boxes also have close or cancel icons embedded in the upper left
corner of the window frame. Clicking on the cancel icon with the left
mouse button, will close the window or dialog. If you are using the
keyboard you can press Escape to cancel a dialog box.
Dialog boxes will contain a variety of controls, from scrolling list
boxes to check boxes and radio buttons. Each control will have an
attached label that describes its purpose. Pressing the highlighted
letter in the label, or clicking on the label or control will move you
to that control. To jump to a new control from a text input line you
will must press Alt and the highlighted letter in the label.
4
Check Boxes and Radio Buttons
Check boxes are used to select one or more items from a list of items.
Radio buttons are used to select a single item from a list. In groups of
check boxes or radio buttons the arrow keys move you between the
different choices. In a check box group you may mark multiple items with
the space bar. In a group of radio buttons you can select only one of
the items, by moving through the group with the arrow keys.
Input Lines
Where keyboard data entry is required, a dialog box will contain a text
input line. When you first enter an input line all existing text will be
highlighted. Typing any alphanumeric character will delete the current
text and replace it with what was just typed. To edit existing input
press the left or right arrow key, Home, End or Insert first, or click
the mouse on the desired position in the text.
With a mouse, press and hold the left button while moving the mouse to
highlight text for deletion. Press the Delete key to remove the
highlighted text.
If the text you have typed is to long to display in the input line, the
text will scroll left and right in the input line. You will see left and
right arrow icons at the start or end of the input line. Press the left or
right arrow keys, or click the mouse on one of the icons, to scroll the text.
Many text input lines will have history lists attached to them. If an
input line has an icon next to it, you may press the down arrow key
or click on the icon to view the history list. Double click the mouse or
press Enter on the highlighted item to place it into the input line.
Windows
BTRV uses text windows to display data. You may have multiple data
windows open at the same time. When there are multiple windows open,
clicking on any part of a window will move it to the front. To close a
window click on the close icon in the upper left corner or press the F4
key.
You can resize a window by pressing and holding the left mouse button
down on the lower right corner of the window. With the mouse button held
down, drag the window corner until the window is the desired size.
Alternately, you can press Ctrl-F5 and use the arrows keys, while
holding down a shift key. Press Escape or Enter when done resizing a
window with the arrow keys.
To move a window, press and hold the left mouse button down on any part
of the top window frame and drag the window to a new position. From the
keyboard press Ctrl-F5 and use the arrow keys, press Escape or Enter
when done.
To zoom or unzoom a window, click the mouse cursor on the zoom icon
located in the upper right corner of the window frame. Double clicking
on the top of the window frame will also zoom or unzoom a window. From
the keyboard you should press the F5 key.
5
Scroll Bars
In list boxes, history lists, or text windows there may be horizontal
and vertical scroll bars. In this case you may use the arrow keys, Page
Up and Page Down to scroll the data. Home will move to the top of the
window, End to the bottom. Page Up and Page Down move by one page, while
Ctrl-Page Up and Ctrl-Page Down move to top and bottom of the list.
With a mouse, click on the Up or Down arrow icons to scroll the data one line
at a time. You may also click below or above the position indicator icon, in
the scroll bar, to scroll by one page. Optionally, you may hold down the
left mouse button on the position icon and drag the icon to reposition the
data.
File Menu Options
The File menu contains all the file related options in BTRV. You can
open, create, clone, recover, load, or save a file. In addition, you can
set or clear file owner names, unload and reset the Btrieve Record
Manager.
PLEASE NOTE: Early versions of Btrieve (prior to 5.0) have no protection
against overwriting existing files. Be careful not to enter the name of
an existing file when entering the new filename for the create, recover,
or clone operations.
Opening a File
You can have only one file open at a time, multiple files is a feature
for some future version. If you already have a file open, this option is
disabled until you close the current file. You open a file from the File
menu or by pressing Ctrl-O.
╔═[*]════════════════ Open File ════════════════════╗
║ File Owner ║
║ [*.* ] [ ] ║
║ ║
║ Directory Open Mode ║
║ [C:\TP\B\ ] (*) Normal ║
║ ( ) Accelerate ║
║ Files Directories ( ) Read Only ║
║┌──────────────┬───────────────┐ ( ) Verify ║
║│ B.BAT # ..\ # ( ) Exclusive ║
║│ BAK.BAT ║ TEST\ ║ ║
║│ BT.BAT ║ A:\ ║ ║
║│ BTRIEVE.TPU ║ B:\ ║ ║
║│ BTRIEVE.TRN ║ C:\ ║ [ Open ]▄ ║
║│ BTRV.ASC ║ ║ ▀▀▀▀▀▀▀▀ ║
║│ BTRV.CFG ║ ║ ║
║│ BTRV.DOC ║ ║ [Cancel]▄ ║
║│ BTRV.EXE ║ ║ ▀▀▀▀▀▀▀▀ ║
║│ BTRV6.PAS ║ ║ ║
║└──────────────┴───────────────┘ ║
║ B.BAT 46 02/28/1992 07:08pm ║
╚═══════════════════════════════════════════════════╝
Figure 2 - Open File Dialog Box
6
To open a file you will be working in the Open File dialog box as seen
above. You may type in a full path and filename, a file mask with wild
card characters or use the file selection list. There is also a history
list attached to the filename input that can be used to retrieve
previously used filenames or masks.
The file you open can be on any drive or in any directory. Use the
directories list box to switch drives or directories. Highlight a drive
or directory. Next press Enter, double click on it with the mouse, or
press the Open button to switch to the directory or drive.
The files in the current directory will be displayed in the files list
box. Just highlight a file, then press Enter, double click on it with
the mouse, or press the Open button to open it.
Both the file and directory list boxes will do incremental searches.
When you are in one of the boxes, type as many letters as needed to
reach a desired file. Use the Backspace key to remove letters and backup
in your search.
If a file has been setup with an owner name, you will need to specify
that name to open the file. The owner name must exactly match the one
previously assigned to that file (please see your Btrieve manual for
more information).
There is also a set of radio buttons that can be used to set the open
mode. The standard Btrieve modes are summarized below, Normal is the
default mode.
┌───────────────────────────────────────────────────────────────┐
│ Mode Description │
│ Normal The default mode, no special features. │
│ Accelerate Disables Btrieve's data recovery features. │
│ Read Only Allows access to a damaged file. │
│ Verify Enables DOS verify option. │
│ Exclusive Gives the workstation exclusive access to a file. │
└───────────────────────────────────────────────────────────────┘
Table 1 - Btrieve File Open Modes
Creating a File
The create file dialog allows you to specify all of a file's attributes.
You can specify any characteristics available for Btrieve files. Three
pieces of information must be entered, the filename, the record length,
and the file page size. In addition you may add an alternate collating
sequence, set any special file flags, set the number of data pages to
preallocate to the file, and the free space threshold the file should
maintain.
7
╔[*]════════════════════════════ Create File ══════════════════════════════╗
║ File Name and Path File Flags ║
║[ ] [ ] Variable Length Records ║
║ [ ] Blank Truncation ║
║ Alt Collating Sequence [ ] Data Compression ║
║[ ] [ ] Key Only ║
║ ║
║ Page Size Record Size [0 ] Free Space ║
║ (*) 512 Bytes (*) 0 % ║
║ ( ) 1024 Bytes PreAllocate [0 ] ( ) 10 % ║
║ ( ) 1536 Bytes ( ) 20 % ║
║ ( ) 2048 Bytes ( ) 30 % ║
║ ( ) 2560 Bytes ║
║ ( ) 3072 Bytes ║
║ ( ) 3584 Bytes [ Create ]▄ [ Cancel ]▄ [ Define Keys ]▄ ║
║ ( ) 4096 Bytes ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ║
╚══════════════════════════════════════════════════════════════════════════╝
Figure 3 - Create File Dialog Box
When you have defined the file's attributes, press the Define Keys
button. This will bring up a dialog box, as seen below, for defining the
first key in the file. In this dialog you will set the key type, key
attributes, key size, key position in the record and the key's null
value. You must set the key type, position and length, all other
information is optional.
╔═[*]═══════════════ Key Segment #1 ════════════════════╗
║ Key Type Key Attributes ║
║ (*) String [ ] Duplicate ║
║ ( ) Integer [ ] Modifiable ║
║ ( ) Float [ ] Null ║
║ ( ) Date [ ] Segmented ║
║ ( ) Time [ ] Alt Collating Sequence ║
║ ( ) Decimal [ ] Descending ║
║ ( ) Money [ ] Manual ║
║ ( ) Logical ║
║ ( ) Numeric Position [0 ] ║
║ ( ) BFloat ║
║ ( ) LString Key Length [0 ] ║
║ ( ) ZString ║
║ ( ) Unsigned Binary Null Value [0 ] ║
║ ( ) Auto Increment ║
║ ║
║ [ OK ]▄ [ Cancel ]▄ [ Next Key ]▄ [ Prev Key ]▄║
║ ▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀║
╚═══════════════════════════════════════════════════════╝
Figure 4 - Define Keys Dialog Box
You may define up to 24 keys or key segments. When you are done with a
key, press the Next Key button to define another key, or press the Prev
Key button to go back to the previous key definition. When all the keys
have been defined press the OK button to return to then main file create
dialog.
In the main dialog press the Create button to create your new file. Note
that the file is not open after it is created.
8
If you need more information on file attributes or defining keys please
refer to your Btrieve manual.
Cloning a File
Clone will create an empty copy of a file. The cloned file will have
attributes identical to the original file, but will be empty. First, you
must select the file to be cloned. This is done in the dialog box shown
below. You may type a full path name or select one from the list of
files. If the file has an owner, it must be specified in the Owner
field. Press the Open button when you have a file selected. A second
dialog box will open. Here you must type the name of the new file and
press the OK button to clone the file.
╔═[*]══════════════ File to Clone ══════════════════╗
║ File Owner ║
║ [*.* ] [ ] ║
║ ║
║ Directory ║
║ [C:\TP\B\ ] ║
║ ║
║ Files Directories ║
║┌──────────────┬───────────────┐ ║
║│ B.BAT # ..\ # ║
║│ BAK.BAT ║ TEST\ ║ ║
║│ BT.BAT ║ A:\ ║ ║
║│ BTRIEVE.TPU ║ B:\ ║ ║
║│ BTRIEVE.TRN ║ C:\ ║ [ Open ]▄ ║
║│ BTRV.ASC ║ ║ ▀▀▀▀▀▀▀▀ ║
║│ BTRV.CFG ║ ║ ║
║│ BTRV.DOC ║ ║ [Cancel]▄ ║
║│ BTRV.EXE ║ ║ ▀▀▀▀▀▀▀▀ ║
║│ BTRV.PAS ║ ║ ║
║└──────────────┴───────────────┘ ║
║ B.BAT 46 02/28/1992 07:08pm ║
╚═══════════════════════════════════════════════════╝
Figure 5 - Clone File Dialog Box
Recovering A File
This option will read all records from one Btrieve file and copy them to
a new Btrieve file. You can use it to recover records from damaged
files. Recover can also be used to compact a file, by creating a copy
with all deleted records removed.
First, you must select the file to be recovered. This is done in a
dialog box identical to the one for file cloning. In a second dialog box
you will enter the name for the new file.
Loading A File
Load will read a DOS file created by the Save operation described below,
or the Butil Save or Recover operations. Load inserts all records from a
DOS file into a Btrieve file. Load works identically to the Butil Load
operation.
9
First, you select the file that will have records loaded into it. This
is done in a dialog box identical to the one for file cloning. In a
second dialog box you select the DOS file to be loaded.
Saving A File
Use Save to create a file to for use with Load or Butil. First, you
select the file to be saved. This is done in a dialog box identical to
the one for file cloning. In a second dialog box you will enter the name
for the DOS file that records will be saved to.
Set Owner
This option is disabled unless you have a file open. Use it to add an
owner name to the file. An owner name can be up to eight characters in
length. Once you set an owner name, you will need to supply the exact
same name every time you open the file.
In addition, you can set the file access mode for use after the owner is
set. The possible access modes are summarized below, Owner Required is
the default mode.
┌──────────────────────────────────────────────────────────────────────┐
│ Mode Description │
│ Owner Required Requires owner name for any access. │
│ Read Only without Owner Permits read-only access without owner name. │
│ Owner Required/Encrypt Requires owner name for any access, data is │
│ encrypted. │
│ Read Only/Encrypt Permits read-only access without owner name, │
│ data is encrypted. │
└──────────────────────────────────────────────────────────────────────┘
Table 2 - File Access Modes with Owner
Clear Owner
This option is disabled unless you have a file open. Use this option to
remove a owner name from a file.
Unload Btrieve
This option executes a standard Btrieve stop or operation number 25.
Needless to say, you should not pick this unless you are done using the
program.
Reset Btrieve
The Reset option issues a operation number 28 to the record manager.
Reset will close any open files, release all locks, and abort any
transaction.
View Menu Options
The View menu gives you access to the various viewing options in BTRV.
These include viewing the key buffer, record buffer, file statistics,
and Btrieve version number.
10
View File Statistics
┌─[*]─────────────── File Statistics: CUSTOMER.DAT ───────────────────┐
│ Record Length : 700 Record Count : 537 #
│ Page Size : 3584 Unused Pages : 0 ║
│ Variable Length : No Compressed : No ║
│ Key Only : No Blank Truncation: No ║
│ Preallocation : No Free Threshold : ║
│ Key Count : 2 Longest Key : 41 ║
│ Total Segments : 2 Current Index : 0 ║
│ ║
│ Key Pos Size Type Dup Mod Man Alt Sup Nul Total ║
│ ───────────────────────────────────────────────────────────────── ║
│ 0 1 10 LString No No No No No ^ 537 ║
│ 1 11 31 LString Yes Yes No Yes No ^ 532 ║
│ ║
└─────────────────────────────────────────────────────────────────────┘
Figure 6 - Viewing File Statistics
This is a convenient way to do a quick check on a file. It lists all the
information about a file that Btrieve returns. This includes the record
size, page size, record count, file flags, and key definitions for each
key segment defined in the file.
View Data Buffer
Select this option to look at the current record in a file's data
buffer. This option is only available if you have a file open. The
window displayed is very similar to those commonly used in disk file
editors. You get two views of the data, one in ASCII characters and one
in Hexadecimal notation.
┌─[*]───────────── Data Buffer: CUSTOMER.DAT ─────────────────┐
│092020202020202020311E436173682053616C65│ 1 Cash Sale #
│2020202020202020202020202020202020202020│ ║
│201E202020202020202020202020202020202020│ # ║
│202020202020202020202020035A20201E202020│ $Z ║
│2020202020202020202020202020202020202020│ ║
│202020202020201E202020202020202020202020│ % ║
│2020202020202020202020202020202020200F20│ ^ ║
│2020202020202020202020202020000000000000│