Skip navigation.
 
mlRe: Database
FROM : Joe Schiwall
DATE : Sun Jan 13 22:10:20 2002

on 1/7/02 10:17 PM, Kent Glenn at <email_removed> wrote:

> I'm building an application that needs a single user/local database. I
> really don't want to have the user install MySQL, since I think it's an
> overkill for what I need.
>
> I will basically need to hold customer records, with a few other small
> tables. There will be some relationships. I'm guessing that on the avg.,
> there will be around 5000 customer records.


Like everybody else I would love to see EOF for Obj-C/Cocoa.  Just having
the flat file database adapter would be a big help, but I am not expecting
anything soon.

In the meantime, I came across an open source, LGPL licensed database engine
you may want to look at.  I haven't tried it myself yet but the web site is:

<http://linux.techass.com/projects/xdb/>

I looked at the sample code and it looks like it might be nice for what you
are trying to do, for example, to create a table:

  xbSchema MyRecord[] =
  {
    { "FIRSTNAME", XB_CHAR_FLD,    15, 0 },
    { "LASTNAME",  XB_CHAR_FLD,    20, 0 },
    { "BIRTHDATE", XB_DATE_FLD,      8,  0 },
    { "AMOUNT",    XB_NUMERIC_FLD,  9,  2 },
    { "SWITCH",    XB_LOGICAL_FLD,  1,  0 },
    { "FLOAT1",    XB_FLOAT_FLD,    9,  2 },
    { "FLOAT2",    XB_FLOAT_FLD,    9,  1 },
    { "FLOAT3",    XB_FLOAT_FLD,    9,  2 },
    { "FLOAT4",    XB_FLOAT_FLD,    9,  3 },
    { "MEMO1",    XB_MEMO_FLD,    10, 0 },
    { "ZIPCODE",  XB_NUMERIC_FLD,  5,  0 },
    { "",0,0,0 }
  };

and to access the records:

  cout << "\nLoop through backwards.." << endl;
  rc = MyFile.GetLastRecord();
  while( rc == XB_NO_ERROR )
  {
//    MyFile.GetField( lname, buf );
    cout << "Last Name = " << MyFile.GetStringField( lname ) << endl;
    cout << "Logical Field = " << MyFile.GetLogicalField( "SWITCH" ) <<
endl;
    rc = MyFile.GetPrevRecord();
  }


If the engine is decent, maybe we can put an Obj-C wrapper on it so the
cocoa community would at least have some kind of DB solution for now.

Hope that helps,

Joe Schiwall
MacTelligence


Related mailsAuthorDate
mlDatabase Kent Glenn Jan 8, 04:17
mlRe: Database Troy Brumley Jan 8, 04:28
mlRe: Database Michael D'Haem Jan 8, 04:42
mlRe: Database Jim Puls Jan 8, 04:52
mlRe: Database Finlay Dobbie Jan 8, 20:23
mlRe: Database Thomas Hudson Jan 8, 20:43
mlRe: Database Andreas Monitzer Jan 8, 20:55
mlRe: Database heckj Jan 8, 22:20
mlRe: Database michel RENON Jan 9, 16:32
mlRE: Database Todd Blanchard Jan 10, 02:12
mlRe: Database Jeff Galyan Jan 10, 02:59
mlRe: Database Kent Glenn Jan 10, 03:00
mlRe: Database Chris Hanson Jan 10, 07:28
mlRe: Database Jeff LaMarche Jan 10, 08:57
mlRe: Database Kaelin Colclasure Jan 10, 18:53
mlRe: Database Dan Waylonis Jan 11, 05:19
mlRE: Database Todd Blanchard Jan 11, 19:13
mlRe: Database Joe Schiwall Jan 13, 22:10
mlRe: Database Simon Stapleton Jan 14, 12:48
mlRe: Database Joe Schiwall Jan 14, 17:24
mlRe: Database Kaelin Colclasure Jan 14, 18:37
mlRe: Database Andreas Monitzer Jan 14, 20:32
mlRe: Database Chris Hanson Jan 15, 03:10