Another dump question

Joakim Schramm joakim at astrocalc.com
Thu Dec 7 21:24:18 CST 2006


Ok this look better?

Public Function InitChartDB() As Boolean

On Error GoTo ErrHandler

DbPath = ChartDir + "Charts.vdb"
Set mChartDB = New VDatabase

With mChartDB
    .InitLocal kStorageDisk
    .DateFormat = EVDateFormat.kYMD

    'If Database not exists we create it.
    If Not FileExists(DbPath) Then
        .LoadDump DbSchemaDir & "Charts.xml", DbPath, kXML
        '.InitLocal kStorageDisk
        '.DateFormat = EVDateFormat.kYMD
        ^^^^^^^^^^^^^^^^^^^^^^^^^^ Or do I need these 2 rem out lines?
    Else
        .Open DbPath
    End If

    .CollationAttribute(kStrength) = kSecondary

    If .IsOpen Then
        InitChartDB = InitTableFieldObjects ' check open and set Tbl & fld
referenses
    End If

End With

Exit Function

ErrHandler:
DisplayError "InitChartDB"
End Function

Other question related to this, can I set Language/Locale when I Load a
dump, different from what is in dump? Or if we look at it the other way
around "what" can I NOT change after database been created and or
Loaded/opened? That would be very useful information to have. I know some
properties must be set before orpen and some after, but what is bound to
created db?

/Joakim
> 
> Hmm, let me check your original letter.
> We have understand it in other way.
>  
> 
> > ------------------------------------------------------
> > Public Function InitChartDB() As Boolean
> > 
> > On Error GoTo ErrHandler
> > 
> > Set mChartDB = New VDatabase
> > 
> > With mChartDB
> >     .InitLocal kStorageDisk
> >     .DateFormat = EVDateFormat.kYMD
> > End With
> > 
> > DbPath = ChartDir + "AstCharts.vdb"
> > 
> > 'If Database not exists we create it.
> > If Not FileExists(DbPath) Then
> > 
> >     With mChartDB
> >         .LoadDump DbSchemaDir & "Charts.xml", DbPath, kXML
> 
> Joakim, look, in this example, you simply
>     load dump into mChartDB  -- GOOD
> 
> Now you do Close and you create NEW INSTANCE of VDatabase 
> (old will die)
> 
> >         .Close
> >         Set mChartDB = New VDatabase
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this 2 lines 
> are not required.
> 
> >         .InitLocal kStorageDisk
> >         .DateFormat = EVDateFormat.kYMD
> >     End With
> > 
> > End If
> > 
> > mChartDB.Open DbPath
> 
>     and now you open again...
> 
> > InitChartDB = CheckOpenChartDB ' check open and set Tbl & fld 
> > referenses
> 
>  
> > Exit Function
> > 
> > ErrHandler:
> > DisplayError "InitChartDB"
> > End Function
> > ------------------
> 
> 
> 
> 
> --
> Best regards,
> 
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
> 
> Valentina - Joining Worlds of Information http://www.paradigmasoft.com
> 
> [I feel the need: the need for speed]
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
> 



More information about the Valentina mailing list