From Data To Database

The compiler converts content source files to database records and fields. Here are the definitions for the data structures the compiler uses to make the conversion.


Dim mDb As database
Dim mtbItem As table
Dim mtbScreen As table
Dim mtbHyper As table
Dim mtbTmp As table    'temp storage for long strings
Rem database vars

Type ItemRecord
    itemtitle As String
    parent As String
    sortorder As String
    itemid As String
    itemtype As String
    screenid As String
    SkimText As String
End Type

Type ScreenRecord
    screentitle As String
    screenid As String
    ScreenType As String
    Filter As String
    history As Integer
    MEdiaId As String
    HotId As String
    Text As String
    parentid As String
    sortpath As String
    lastupdate As String
    orderid As String
End Type

These definitions are local to one module where all database interaction occurs. This avoids a bug in Visual Basic where database variables that are globally defined are not recognized. The mtbTmp table is actually another version of the screen table that we use only for temporary storage. The type variables help keep track of the various fields in the Screen and Item tables.