Announcement

Collapse
No announcement yet.

"dBase Library for PB-DOS" Contribution

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

  • "dBase Library for PB-DOS" Contribution

    And again, PowerBasic for DOS is not death.
    For many cases, the old dBase DBF file format is still the best choice to use.
    The old rule "fixed length records waste a lot of valuable space" also won't really matter in todays time, where a "normal" OS already grabbs a few GB of your harddisc.

    Flat files, speedy access, transparent and calculatable records, still a great solution for all kind of medium sized datastructures.

    How easy to handle any kind of dataset with a predefined number of records ...
    How easy to handle a whole year on a daily base. Just use a DBF file with 365 records ...

    The library is available for PB-Dos and PB-Win/CC, using exact the same commands.

    To handle further updates and changes better, I decide to host the whole archive on my own webspace. Please go to below link to download the actual archive as well as additional informations (if available) ...

    www.china-bizz.com/software/powerbasic


    The dBase file format is well designed, but not completely documented for public. A lot of analysis and debugging was necessary to build up this library. All my thanks goes to

    Daniel P. Stasinski
    Richard Maurino
    Erik Olson
    and Manuel Valdes
    This library is based on ideas, code and inspirations from them.

    If anybody has some ideas for functions or other enhancements, feel free and drop me a PM ...
    Hopefully, this all is still useful for somebody out, at least for me it is ...

    Have fun

    Gerry
    Last edited by Gerhard Kropf; 21 Jul 2015, 08:15 AM. Reason: typo :-)

  • #2
    First, this is agreement, dBase files can still be useful (and not just PBDOS).

    More than flat and fixed record count databases, also relational and multiple indexes.

    It is well documented if you use the AKA "XBase". For example see https://en.wikipedia.org/wiki/XBase, and included link http://www.clicketyclick.dk/database...mat/index.html.

    ((minor question - how did you arrive at 364 records in annual database? typo?))

    Easier to manually repair an XBase file than an mdb.

    Cheers,
    Dale

    Comment


    • #3
      >For many cases, the old... is still the best.
      Yes...I'm a fan.
      Thanks Gerry...Great stuff!

      Comment


      • #4
        >The library is available for ....PB-Win/CC, using exact the same commands.

        Also available on Win/32:

        dbase ODBC drivers:
        https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx

        dbase (IV) OLE provider
        https://www.connectionstrings.com/dbf-foxpro/

        These options are NOT available under MS-DOS.

        MCM

        Comment


        • #5
          The right tool for a given job ...

          There might be situations, where you really need ODBC, JET, SQL, Btrieve, c-treeACE, FLAIM, NuoDB, BDB, ... or one of the variouse others around.

          And in times, where a simple "hello world cooking recipe administration tool" with 45MB filesize can be sold, many people consider the above as a cool solution to handle a few 100 recipes.

          But to be fair, we should also accept, that such solutions are "sometimes" a bit oversized and overkilled.

          Please, keep this thread clean, it is no flame war pro or against something. It is just a contribution for all outside, who will have a benefit from. And I guess, the people who do have a benefit from know this very well.

          G.

          Comment


          • #6
            But to be fair, we should also accept, that such solutions are "sometimes" a bit oversized and overkilled.
            Let's also be fair to those who design commercial package solutions for business.

            What might be 'oversize' or 'overkill' for 'User A' could be just barely sufficient for 'User B.' As a designer you pretty much have to deal with the "worst case scenario."

            I have said for many years both here and elsewhere that what makes a particular software solution "right" is totally and completely up to the user. I have no reason to change my story now.


            MCM

            Comment


            • #7
              again, "The right tool for a given job ..."
              btw. thats why we all use PowerBasic, "because all the .NET spoiled mass-users out cry for" ...

              G.
              Last edited by Gerhard Kropf; 30 Jul 2015, 09:43 PM.

              Comment


              • #8
                I Spent all day figuring out the TYPES for DBF files and i just found out there is a recend thread for it... hehehe.

                I plan to use this in an android app, i made some UDT's based on these:
                http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm

                Why are some parts of the UDT blank? there are some fields mixed with the unused fields that I think are used. Are these unimplemented features of the example or they never were used in real world?
                www.pluribasic.com

                Comment


                • #9
                  Do you mean the "reserved" members, or the member for the number of digits after the decimal point when a character field is being defined?

                  Been at least a decade since I worker on the guts of a dBase/XBase file. One thing that come immediately to mind is ththat the header and field definitions are padded to a multiple of the record length, then the first record starts.
                  Dale

                  Comment


                  • #10
                    I meant the fields that are betweeen the unused fields. I am not sure that those are for though. That's why i ask.
                    www.pluribasic.com

                    Comment


                    • #11
                      try this reference instead. http://www.clicketyclick.dk/database...tml#DBF_STRUCT

                      The field descriptor items between unused are labeled, so I don't understnd the problem.

                      Maybe confusing data records, which aren't really UDTs with field decriptors which can conveniently kept in UDTs?
                      ????
                      Dale

                      Comment


                      • #12
                        Thanks Dale, it worked.
                        www.pluribasic.com

                        Comment


                        • #13
                          I ported the whole dBase library to FreeBasic ...
                          All versions are supported ... even FBC for ARM on a Raspberry PI

                          Comment


                          • #14
                            I used to read the old stuff direct from the file. Main meat of the code was pretty simple:

                            Code:
                            Type DB3Header
                                ver        As Byte ' 03H without .DBT, 83H with .DBT 
                                year       As Byte
                                month      As Byte
                                day        As Byte
                                numRecords As Dword
                                headerSize As Word
                                recordSize As Word
                                reserved   As Asciiz * 20
                            End Type
                            Type DB3FieldDesc
                                fieldName    As Asciiz * 11
                                fieldType    As String * 1 'CNLDM
                                dataAddress  As Dword
                                fieldLength  As Byte
                                decimalCount As Byte
                                reserved     As Asciiz * 14
                            End Type
                            
                            ' C= Character
                            ' N= Numeric- -.1234567890
                            ' L= Logical- ?YyNnTtFf
                            ' D= Date YYYYMMDD
                            ' M= Memo with 10 digits representing a .DBT Block#
                            sigpic
                            Mobile Solutions
                            Sys Analyst and Development

                            Comment

                            Working...
                            X