Another dump question
Ruslan Zasukhin
sunshine at public.kherson.ua
Thu Dec 7 21:44:46 CST 2006
On 12/7/06 7:47 PM, "Joakim Schramm" <joakim at astrocalc.com> wrote:
>>> Ok and it will then replace structure as well as all content of the
>>> database, or I need to empty it first... Well I will see of course.
>>
>> LOAD of db dump must be done into TOTALLY EMPTY database.
>>
> Ok so what you say contradict with Ivan... And I guess you are "top dog" ;-)
> so to load a dump recreating an existing database (like restoring a backup
> taken as dump) correct way is:
>
> db.Close()
> db.ThrowOut()
> Db.LoadDump ?
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]
More information about the Valentina
mailing list