Home > Archive > Programming with dBASE > October 2005 > Copy files across databases









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Copy files across databases
Alan Fitch

2005-10-11, 7:27 am

I need to transfer files from a workstation where the path to the files is referenced by an alias to a server where the path is again referenced by an alias. The following gives an error message - not allowed across differnt databases -

copy table ":fsa1:fsa.dbf" to ":ctc2data:fsa.dbf"

I have tried using the copy function in an UpdateSet()

dsource = new database()
dsource.databasename = "fsa1"
dsource.active = true
ddestination = new database()
ddestination.databasename = "ctc2data"
ddestination.active = true
qsource = new query()
qsource.sql = "Select * from fsa.dbf"
qsource.database = dsource
qsource.active = true
u = new updateset()
u.source = qsource.rowset
u.destination = ":ctc2data:fsa.dbf"
u.copy()

This copies the data and memo table but not the index table.

Am I doing something wrong or is there a better way?

Alan
Todd Kreuter

2005-10-11, 7:27 am

Alan Fitch wrote:
>
> I need to transfer files from a workstation where the path to the files is referenced by an alias to a server where the path is again referenced by an alias. The following gives an error message - not allowed across differnt databases -
>
> copy table ":fsa1:fsa.dbf" to ":ctc2data:fsa.dbf"


Get the path of the destination database using BDEAlias.cc then

dsource = new database()
dsource.databasename = "fsa1"
dsource.active = true

dSource.copyTable("fsa.dbf", cFile)

Where cFile is the path and file name of the destination.


--
Todd Kreuter [dBVIPS]
Alan Fitch

2005-10-11, 7:27 am


>
> Get the path of the destination database using BDEAlias.cc then
>
> dsource = new database()
> dsource.databasename = "fsa1"
> dsource.active = true
>
> dSource.copyTable("fsa.dbf", cFile)
>
> Where cFile is the path and file name of the destination.
>

Thanks Todd, problem solved.

Alan
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com