From: richard AT NOSPAMstardate DOT bc DOT ca (Richard Sanders) Newsgroups: comp.os.msdos.djgpp Subject: Re: Database access Date: Thu, 09 Oct 1997 03:21:30 GMT Organization: Rapidnet Technologies Internet Lines: 81 Message-ID: <343c493f.2532653@207.102.150.4> References: <34391686 DOT F9FE32AD AT provider DOT com DOT br> <343C27A3 DOT 6CEF AT stud DOT warande DOT ruu DOT nl> NNTP-Posting-Host: wlp25.rapidnet.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Thu, 9 Oct 1997 00:38:59 GMT, Elliott Oti wrote: ->Antonio Dias wrote: ->> ->> Hello all, ->> ->> I'm a newcomer in DJGPP programming and I would like to know if there is ->> any library like CodeBase ported to DJGPP. I'm interested in construct ->> an application for database access with multiuser support and CodeBase ->> offers all that I need but It is not free. So I''m looking for something ->> more inexpensive like DJGPP is. :-) -> ->There is a port of Unix' gdbm to DOS,also called gdbm.I forget where I ->first saw it, probably SimTel, but I can email the zipfile if a WWW ->search turns nothing up. I haven't seen any sources to the DOS version, ->just a library and header files. It does offer multiuser support ( well, ->it controls read access and read-write access for simultaeneous users at ->least). The internet is flooded with free graphics source code, but very ->little database code (I've looked!). I also have a CDROM with some ->reasonably portable free source code for a database on it, that I've ->managed to compile successfully under djgpp using a few #ifdefs. I can ->email it if you want. ->The problem with all these ports is that none of them use the popular PC ->database file formats ( DBase, Access, Paradox etc ) so that you have to ->write conversion utilities yourself. They are also not really relational ->databases at all, simply for hashed-key retrieval, storage and sorting ->of data, and you can completely forget stuff like scripting and query ->languages, unless you are prepared to do that from scratch ( although if ->you're a Unix guru you can probably do amazing things with gdbm in ->combination with sed, awk or perl -- I can't :-). I am using a btree data base, got from a book. "C Database Development" by Al Stevens, published by MIS press, ISBN 1-55828-136-3 This compiles just fine under djgpp but you do have to add #include This book is available with a disk at extra cost, to save the typing. I have tweeked the btree to allow multi user, using lock() and unlock() and also by using _dos_commit(). The data files are treated in a like manner. The btree file should be lock in its entirety while the data file(s) need only the effected record(s) locked. Very important, force the btree header to be written to disk after each opperation that modifies the btree. Just as important is to read the header before using the btree, because the root node could have changed since the last access by an instance of the application. The data is not stored in any of the popular formats, it is stored as data stuctures so it reads and writes with no tinkering. In my current project I am using the btree only and not the higher level API because I am using variable lenght data records. The API sticks you with fixed lengh data. The book gives examples of generting reports, data entry, retrieval. IMHO this book is good, just enough theory to make the understanding easy with the bulk of the book being real meat.