The
dvBTree implementation uses a pure balanced B-Tree algorithm to provide you with a fast and flexible way to index more than two billion records with no limitations on the type of data file.
You can use B-Tree routines to find a given record very quickly even if you are using large data files.
These routines will work with either new or existing sequential or random access data files with no predefinition of structure.
You can index on any string expression and not just fields in the data file. There is not limit to the number of indices you can use.
Usually a B-Tree index does not accept duplicated keys. However
dvBTree lets you use such keys transparently making them unique by adding their record number to the key without enlarging the index size.
No more need to sort:One very useful side effect of using a B-Tree index is that all keys in the index are always sorted alphabetically. To read your key in ascending order, read the index from the first key to the last. Want a descending order ? Just read it from the last to the first.
Specifications:
- B-Tree routines are multi-user and they can be used to share file on a local network.
- B-Tree index sizes are limited to 2^31-1 = 2,147,483,648 bytes.
- Requested room to store one index is : Index Size = (Key Length * 2.5) * Number of records.
- Searches can be performed on a partial or exact matching key.
- An index stores only the keys, and returns the corresponding record number in the main database.
- Keys in an index are always converted to uppercase.
For the members of this community
dvBTree is free. There are no royalties nor fees for distribution with your application :)
Note: For the purpose of speed and optimization
dvBTree uses only low level file I/O API.
Thanks Patrice, downloaded for future study.
Patrice,
what a nice gift !
I have checked your website and you normally sell it for $135...
Another great contribution to PB community ...
Thanks!,
Petr
The first post of this thread has been updated, to fix the ZIP file corruption caused by the "Server Collapse".
...
I thought my version 2.04 was current and found 2 more versions of 2.06.
Notice the difference in dvBtAfter&. My older version is the second one.
FUNCTION dvBtAfter& ALIAS "dvBtAfter" (BYVAL hBtFile&, zRKey AS ASCIIZ, Record&, BtErr&) EXPORT AS LONG
KeyIn$ = zRKey
FUNCTION = Bt&(hBtFile&, 66&, zRKey, Record&, BtErr&)
IF LEN(zRKey) AND zRKey < KeyIn$ THEN
FUNCTION = dvBtNext(hBtFile&, zRKey, Record&, BtErr&)
ELSE
FUNCTION = Bt&(hBtFile&, 69&, zRKey, Record&, BtErr&)
END IF
END FUNCTION
FUNCTION dvBtAfter& ALIAS "dvBtAfter" (BYVAL hBtFile&, zRKey AS ASCIIZ, Record&, BtErr&) EXPORT
'
LOCAL KeyIn AS STRING
LOCAL FirstRecord AS LONG
LOCAL BtErrFirst AS LONG
LOCAL FirstKey AS STRING
KeyIn$ = zRKey
'
' 06-26-2002 Jean-Pierre LEROY
IF Bt&(hBtFile&, 70, zRKey, FirstRecord&, BtErrFirst&) = 0 THEN FirstKey$ = zRKey
zRKey = KeyIn$
FUNCTION = Bt&(hBtFile&, 66&, zRKey, Record&, BtErr&)
IF LEN(zRKey) AND zRKey < KeyIn$ THEN
FUNCTION = dvBtNext(hBtFile&, zRKey, Record&, BtErr&)
ELSE
IF LEN(FirstKey$) AND KeyIn$ < FirstKey$ THEN ' 06-26-2002 Jean-Pierre LEROY
Record& = FirstRecord&
zRKey = FirstKey$
BtErr& = BtErrFirst&
EXIT FUNCTION
END IF
FUNCTION = Bt&(hBtFile&, 69&, zRKey, Record&, BtErr&)
END IF
END FUNCTION
One readme has Version 2.06 from 06-22-2002
Another has Version 2.06 from 05-11-2002
Noticed the download was modified in August of 2011.
Which one is current?
Hello,
In the dvbtree.doc it is stated that dvbtsearch is able to find partial keys. How is such a search to be implemented. In all my tests I succeeded to find only when the search string contained the full key.
(in the xbtree sample the searches are made on full keys.
Thanks for any explanation on this.
HJ
Please look inside the code of the main Bt() function, things should be obvious.
Look also for dvBtnext.
The ZIP file has been updated in august 2011, after the server colapse problem.
But the provided files haven't changed for more than 10 years now, and dvBtree was provided with dv32 in 1996/1997, when the first PB version for Windows was released.
...
Thanks for your prompt response.
I'll keep studying this.
HJ
Patrice,
The version of dvbtree.bas just downloaded shows 5-11-2002
My version shows 6-22-02 with different code dated 06-26-2002 Jean-Pierre LEROY
Should I use the older version posted on this BBS without the Jean_Pierrre LEROY modification?
I can not find dvBText in any version?
'Lastest download Version 2.06 from 05-11-2002
FUNCTION dvBtAfter& ALIAS "dvBtAfter" (BYVAL hBtFile&, zRKey AS ASCIIZ, Record&, BtErr&) EXPORT AS LONG
KeyIn$ = zRKey
FUNCTION = Bt&(hBtFile&, 66&, zRKey, Record&, BtErr&)
IF LEN(zRKey) AND zRKey < KeyIn$ THEN
FUNCTION = dvBtNext(hBtFile&, zRKey, Record&, BtErr&)
ELSE
FUNCTION = Bt&(hBtFile&, 69&, zRKey, Record&, BtErr&)
END IF
END FUNCTION
This code may or may not be more current?
' Version 2.06 from 06-22-2002
FUNCTION dvBtAfter& ALIAS "dvBtAfter" (BYVAL hBtFile&, zRKey AS ASCIIZ, Record&, BtErr&) EXPORT
'
KeyIn$ = zRKey
'
' 06-26-2002 Jean-Pierre LEROY
IF Bt&(hBtFile&, 70, zRKey, FirstRecord&, BtErrFirst&) = 0 THEN FirstKey$ = zRKey
zRKey = KeyIn$
FUNCTION = Bt&(hBtFile&, 66&, zRKey, Record&, BtErr&)
IF LEN(zRKey) AND zRKey < KeyIn$ THEN
FUNCTION = dvBtNext(hBtFile&, zRKey, Record&, BtErr&)
ELSE
IF LEN(FirstKey$) AND KeyIn$ < FirstKey$ THEN ' 06-26-2002 Jean-Pierre LEROY
Record& = FirstRecord&
zRKey = FirstKey$
BtErr& = BtErrFirst&
EXIT FUNCTION
END IF
FUNCTION = Bt&(hBtFile&, 69&, zRKey, Record&, BtErr&)
END IF
END FUNCTION
Mike,
It is rather old, but from the top of my head i would say use the dvBtAfter code change done for Jean-Pierre.
...
It appears the help in one of my versions is also newer.
I haven't done a complete check of all the code.
Do you still use it?
I have attached a new ZIP file with the correct CHM help file, and the latest change from 06-22-2002.
Mike I am still using it in the "ZAP Image Solution" database, however the code is embedded directly into the zBt.dll that does extra things, but i have not integrated the change done for Jean-Pierre, probably because i forgot to do it, as i am not using it in ZIS ;)
...
Really appreciate it! Now they match.
dvbtree.bas compiled with PB9 45,056 bytes.
dvbtree.bas compiled with PB10 47,616 bytes.
It is really great code for indexing anything
while still allowing direct access to the data.
This can be many times faster than other methods.