Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update structures
Message
General information
Forum:
Visual FoxPro
Category:
Stonefield
Miscellaneous
Thread ID:
00661607
Message ID:
00662100
Views:
28
>What additional information do i need to include to keep one set of meta data files for multilple databases with the same structures but in different folders.
>
>Thanks

At a minimum, you need to copy the 3 updated database container files [DBC, DCT and DCX] to each of your database folders. Then provide a copy of the new SDT meta data files to the customer.

Example code to synchronize. I leave the rest for you to fill in, test, etc.
*!* somewhere in your MAIN.PRG file:
private oMeta
oMeta = ""
if not LoadStonefield()
   return .f.
endif
SDTValidate()


PROCEDURE LoadStonefield

if vartype(oMeta) <> "O"
   oMeta = NewObject("DBCXMgr", "DBCXMgr.VCX")
endif
if vartype(oMeta) <> "O"
   return .f.
endif

ENDPROC

PROCEDURE SDTValidate

local llSDT, lcDBC
lcDBC = dbc()
llSDT = (vartype(oMeta) = "O")
*!* you can also use DBUSED() to get an array of open databases
*!* to restore those when finished

*!* next, make sure all files are closed so validation will complete
oMeta = .null.
close tables all
close databases

if not LoadStonefield()
   *!* return your environment to where it was
   return .f.
endif

oMeta.oSDTMgr.OpenData(".\Database1\MyDBC", .t., .f.)
UpdateDatabase()
oMeta.oSDTMgr.OpenData(".\Database2\MyDBC", .t., .f.)
UpdateDatabase()
oMeta.oSDTMgr.OpenData(".\Database3\MyDBC", .t., .f.)
UpdateDatabase()

oMeta = .null.
close databases
if llSDT
   if LoadStonefield() and not empty(lcDBC)
      oMeta.oSDTMgr.OpenData(lcDBC, .t., .f.)
   endif
endif

ENDPROC

PROCEDURE UpdateDatabase

local llSuccess
llSuccess = .t.
if oMeta.oSDTMgr.NeedUpdate()
   llSuccess = oMeta.oSDTMgr.Update()
endif
return llSuccess

ENDPROC
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform