AW: AW: V4MD: Save DB "As"
Andrew Sinning
andrew at learningware.com
Wed Feb 16 09:03:49 CST 2005
In order to copy the db, I have to close the connection, but this turns
out to be a pretty straight forward process, and it appears to be very
fast. Thanks for your help. I think I am well on my way to having a
Save As function.
on Save me, makeBackup
if IsObject(dbConn) then
dbConn.Flush()
if makeBackup then
-- break dbConn
CloseDatabase(dbConn)
-- copy files to backup
sourceDir = GetContainingPath(dbFile)
backupDir = sourceDir&"dbBack"&Slash()
baCreateFolder(backupDir)
fileRoot = GetLastPathItem(dbFile)
repeat with ext in dbExtensions -- [ "vdb", "dat", "ind", "blb"]
fileName = fileRoot&"."&ext
baCopyFile(sourceDir&fileName, backupDir&fileName, "Always")
end repeat
-- remake dbConn
OpenDatabase(dbConn, dbFile)
end if
end if
end
Andrew Sinning wrote:
> I think what you are suggesting is that Flushing the db will un-lock
> it so that it is possible to make a copy of it. Everything I've tried
> up until now has stumbled over the locked-db file (can't be copied).
>
> I'll give this a try. Thanks!
>
> Florian Bogeschdorfer wrote:
>
>> Save: flush, delete first copy, copy current database to a backup file
>>
>>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
>
>
More information about the Valentina
mailing list