[V4RB] RAM-based databases

Erik Mueller-Harder erikmh at gmail.com
Sat Jun 23 09:32:49 CDT 2007


After struggling for a while with the example RAM-based database, I've
come to the realization that the problem I've been having with my own
attempts at a RAM-based database are probably due to the fact that
we're required to pretend that the database is going to be a
disk-based database.

In other words, your example code calls this method:

  dim f as folderitem

  // obtain folder item for file in the same folder.
  f = GetFolderItem("Database1.vdb")

  // We will keep db in the 4 disk files
  mDataBase.Create( f, EVdbMode.kDsc_Dat_Blb_Ind , 32 * 1024 )

which seems absolutely non-intuitive to me for a RAM-based database.
Folderitem? Number and distribution of disk files?

I'd basically been going right from the "create instance" step to the
"populate table" step. By the way, if anyone is getting error -39
(with no associated error message), that's what I've been getting at
the table.AddRecord step when omitting the above code.

I guess I'm asking for confirmation that this is really the proper way
to go about making a RAM-based database:

- Create instance
- Create database (pretending to give it a file name and storage mode)
- Populate it with data

Is this really correct?

Thanks,

-- Erik


More information about the Valentina mailing list