Hi,

somebody knows how to copy a local view from one DBC to a nother one? I
have to do it programatically because enduser has been enambled to change
the view on the first DBC and I need to make sure that the second one is
identical

up to date I have tried copying the corresponding records from the DBC using
the following code

use (rutadest+"\aedb.dbc")
append from (rutaorig+"\aedb.dbc") for objectname = "vcalif "
set filter to objectname = "vcalif "
go top
wobjectid = objectid
set filter to
append from (rutaorig+"\aedb.dbc") for parentid = wobjectid
use

However, when I try to open the database I get an error message " database
is corrupted and this can not be fixed using validate database command

I also tried changing the objecid of the view with a very big number (to
avoid duplicates) but it did not fix the trouble

select 0
use (rutadest+"\aedb.dbc")
append from (rutaorig+"\aedb.dbc") for objectname = "vcalif "
set filter to objectname = "vcalif "
replace objectid with 999999
go top
wobjectid = objectid
set filter to
append from (rutaorig+"\aedb.dbc") for parentid = wobjectid
use

I really would appreciate any help

Oscar Taboada

Re: how to copy a View from one DBC to a second DBC by Stefan

Stefan
Mon Oct 25 02:46:02 CDT 2004

You can use DbGetProp() to query each required property of the current
view and then use the Create View command + several DbSetProp()
calls to re-create it in the the new DBC.
See also "gendbc.prg" shipped in Vfp's Home() folder.


hth
-Stefan

"oscar taboada" <taboada@asur.com.mx> schrieb im Newsbeitrag
news:%23BfX9PmuEHA.2536@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> somebody knows how to copy a local view from one DBC to a nother one? I have to
> do it programatically because enduser has been enambled to change the view on the
> first DBC and I need to make sure that the second one is identical
>
> up to date I have tried copying the corresponding records from the DBC using the
> following code
>
> use (rutadest+"\aedb.dbc")
> append from (rutaorig+"\aedb.dbc") for objectname = "vcalif "
> set filter to objectname = "vcalif "
> go top
> wobjectid = objectid
> set filter to
> append from (rutaorig+"\aedb.dbc") for parentid = wobjectid
> use
>
> However, when I try to open the database I get an error message " database is
> corrupted and this can not be fixed using validate database command
>
> I also tried changing the objecid of the view with a very big number (to avoid
> duplicates) but it did not fix the trouble
>
> select 0
> use (rutadest+"\aedb.dbc")
> append from (rutaorig+"\aedb.dbc") for objectname = "vcalif "
> set filter to objectname = "vcalif "
> replace objectid with 999999
> go top
> wobjectid = objectid
> set filter to
> append from (rutaorig+"\aedb.dbc") for parentid = wobjectid
> use
>
> I really would appreciate any help
>
> Oscar Taboada
>