How to copy whole database (including tables) ? 
Author Message
 How to copy whole database (including tables) ?

One thing to explore is RUN Xcopy ...... which I believe with the correct options copies the subdirectories as well

  Hello,

  maybe a stupid question, but how do I copy a whole database (.dbc),
  including all tables, memo fields, stored procedures, ... ?

  "copy to " I only can use for tables, and I have to do this
  for every table which belongs to a database.

  Doing a copy using the DOS-Prompt or Windows-Explorer will work, but
  there I also have to know every table, which belongs to the database.

  Any tiny command, which does what I want (and knows, which
  tables belong to a database)?

  Many thanks for your help!

  Best regards

  Juergen

  Sent via Deja.com http://www.*-*-*.com/
  Before you buy.



Sat, 22 Feb 2003 15:42:00 GMT  
 How to copy whole database (including tables) ?
Hi,
Unfortunately, there is no simple command to copy an entire database.
The easiest thing to do is to move all of the database files (*.DBC,
*.DBX, *.DBT, *.DBF, *.CDX, *.FPT, *.IDX) into a seperate folder.  Then
when you want to duplicate the database, you can simply copy the folder.

- Keith



Quote:
> Hello,

> maybe a stupid question, but how do I copy a whole database (.dbc),
> including all tables, memo fields, stored procedures, ... ?

> "copy to " I only can use for tables, and I have to do this
> for every table which belongs to a database.

> Doing a copy using the DOS-Prompt or Windows-Explorer will work, but
> there I also have to know every table, which belongs to the database.

> Any tiny command, which does what I want (and knows, which
> tables belong to a database)?

> Many thanks for your help!

> Best regards

> Juergen

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Sat, 22 Feb 2003 21:41:41 GMT  
 How to copy whole database (including tables) ?

Hey guys,

Let's not forget about GenDBC.prg!

Look for this prg that ships with VFP
wherever you've installed it.  This
handy little thing will create code that
will generate a DBC with DBF's, CDX's, etc.
from an open database.

HTH,

Maya


Quote:
> Hello,

> maybe a stupid question, but how do I copy a whole database (.dbc),
> including all tables, memo fields, stored procedures, ... ?

> "copy to " I only can use for tables, and I have to do this
> for every table which belongs to a database.

> Doing a copy using the DOS-Prompt or Windows-Explorer will work, but
> there I also have to know every table, which belongs to the database.

> Any tiny command, which does what I want (and knows, which
> tables belong to a database)?

> Many thanks for your help!

> Best regards

> Juergen

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sat, 22 Feb 2003 23:13:56 GMT  
 How to copy whole database (including tables) ?


Quote:
> Hello,

> maybe a stupid question, but how do I copy a whole database (.dbc),
> including all tables, memo fields, stored procedures, ... ?

> "copy to " I only can use for tables, and I have to do this
> for every table which belongs to a database.

> Doing a copy using the DOS-Prompt or Windows-Explorer will work, but
> there I also have to know every table, which belongs to the database.

Check out the help for the ADBOBJECTS() function.  This can tell you
all the tables in a DBC, and from there you can copy DBFs, CDXs, and
FPTs for the given tables.  Then, copy the DBC, DCT, and DCX for the
database container itself, and you should be all done!

Quote:
> Any tiny command, which does what I want (and knows, which
> tables belong to a database)?

ADBOBJECTS() should help a lot.  Good luck!

JoeK

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 22 Feb 2003 23:31:58 GMT  
 How to copy whole database (including tables) ?
One thing I would suggest - put the database and all it's tables together in
their own directory.
Don't put any tables that don't belong to the database in this directory.
This will make maintenance a LOT easier in the long run.

Then to copy, just use COPY FILE *.* TO \newdir\*.*


Quote:
> Hello,

> maybe a stupid question, but how do I copy a whole database (.dbc),
> including all tables, memo fields, stored procedures, ... ?

> "copy to " I only can use for tables, and I have to do this
> for every table which belongs to a database.

> Doing a copy using the DOS-Prompt or Windows-Explorer will work, but
> there I also have to know every table, which belongs to the database.

> Any tiny command, which does what I want (and knows, which
> tables belong to a database)?

> Many thanks for your help!

> Best regards

> Juergen

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sun, 23 Feb 2003 09:53:19 GMT  
 How to copy whole database (including tables) ?

There is only one problem with the "gendbc"  idea. The program gendbc.prg is
not very smart and if you have enough tables/views in your database it will
generate a program that is too large for vfp to run. Needless to say the
resulting program is useless.  And if the program is small enough to run you
may still have a problem. If you have views that are based on other views
you have no guarantee that gendbc will create them in the proper order. Thus
if view B required view A gendbc might try to make view B first you have no
control over this.

BUT, all is not lost. If you look at gendbc.prg you can see what commands it
issues and create your own program to record/create a new copy of your
database.  I have one that scans the views and creates a program to recreate
them.  That way if I add columns to my database I don't have to revisit each
view to make sure I did not break it 8-)

Alan Sheffield
www.sheffieldsystems.com


Quote:
> Hey guys,

> Let's not forget about GenDBC.prg!

> Look for this prg that ships with VFP
> wherever you've installed it.  This
> handy little thing will create code that
> will generate a DBC with DBF's, CDX's, etc.
> from an open database.

> HTH,

> Maya



> > Hello,

> > maybe a stupid question, but how do I copy a whole database (.dbc),
> > including all tables, memo fields, stored procedures, ... ?

> > "copy to " I only can use for tables, and I have to do this
> > for every table which belongs to a database.

> > Doing a copy using the DOS-Prompt or Windows-Explorer will work, but
> > there I also have to know every table, which belongs to the database.

> > Any tiny command, which does what I want (and knows, which
> > tables belong to a database)?

> > Many thanks for your help!

> > Best regards

> > Juergen

> > Sent via Deja.com http://www.deja.com/
> > Before you buy.



Mon, 03 Mar 2003 03:00:00 GMT  
 How to copy whole database (including tables) ?


Quote:
> There is only one problem with the "gendbc"  idea. The program gendbc.prg
is
> not very smart and if you have enough tables/views in your database it
will
> generate a program that is too large for vfp to run. Needless to say the
> resulting program is useless.  And if the program is small enough to run
you

That's been changed. The current version doesn't create a single procedure
that can beak the 64K-byte limit, it consists of lots of small procedures on
for each table or view.
-Anders


Wed, 05 Mar 2003 03:00:00 GMT  
 How to copy whole database (including tables) ?

Quote:
> That's been changed. The current version doesn't create a single procedure
> that can beak the 64K-byte limit, it consists of lots of small procedures
on
> for each table or view.
> -Anders

That's good to hear. Most of the I got frustrated with the 5.0 versions
limits a while ago and never looked into the 6.0 version. I just kept using
my own code.

Alan



Fri, 07 Mar 2003 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. whole child database in report?

2. copying table data between databases

3. Copy tables between Databases

4. Table/cursor open during the whole session

5. Upload a whole Table to SQL server

6. how can i close all tables on the whole network

7. COPY FILE .. with an included BITMAP

8. including databases in project

9. Error 12 when using BUILD APP that includes a database

10. Database - tables not showing - MODI DATABASE

11. Free Tables include or exclude?

12. Opening free table included in app via ODBC

 

 
Powered by phpBB® Forum Software