PC Review


Reply
Thread Tools Rate Thread

Copy a Table

 
 
Wayne Wengert
Guest
Posts: n/a
 
      12th Aug 2004
When a specific event occurs I want to make backup copies of 2 tables using
names like "BkupTbla081204.xml" and "BkupTblb081204.xml". What is the best
way to do this? I suspect there is some simple method that I have
overlooked.

Wayne


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      13th Aug 2004
Wayne,

> When a specific event occurs I want to make backup copies of 2 tables

using
> names like "BkupTbla081204.xml" and "BkupTblb081204.xml". What is the best
> way to do this? I suspect there is some simple method that I have
> overlooked.
>
> Wayne

What do you want to know how to make the name or how to write the table,
however a complete solution?

dim myfilename as string = "BkupTbla" & Now.tostring(MMddyy) & ".xml"
myds.writeXML(myfilename)
myfilename = "BkupTblb" & Now.tostring(MMddyy) & ".xml"
myds.writeXML(myfilename)

Because of the current date and your sample I think you want the US date
notation and I have made it in that, for most other countries you have to
change the dd and the MM in the sample. (This is for when someone search on
this sample).

I hope this helps?

Cor


 
Reply With Quote
 
Wayne Wengert
Guest
Posts: n/a
 
      13th Aug 2004
Cor;

Thanks for the response. The solution you offered creates a backup table
from the open dataset. I am looking for a way to make a copy of a table when
the contents of that table are not open in a dataset. I guess I could read
the table into a dataset and then write that out to a new table but I was
looking for some sort of simple table copy process?

Wayne

"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Wayne,
>
> > When a specific event occurs I want to make backup copies of 2 tables

> using
> > names like "BkupTbla081204.xml" and "BkupTblb081204.xml". What is the

best
> > way to do this? I suspect there is some simple method that I have
> > overlooked.
> >
> > Wayne

> What do you want to know how to make the name or how to write the table,
> however a complete solution?
>
> dim myfilename as string = "BkupTbla" & Now.tostring(MMddyy) & ".xml"
> myds.writeXML(myfilename)
> myfilename = "BkupTblb" & Now.tostring(MMddyy) & ".xml"
> myds.writeXML(myfilename)
>
> Because of the current date and your sample I think you want the US date
> notation and I have made it in that, for most other countries you have to
> change the dd and the MM in the sample. (This is for when someone search

on
> this sample).
>
> I hope this helps?
>
> Cor
>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      13th Aug 2004
Wayne,

The same simplicity I assume you have an existing one you want to protect, a
good idea with a XML file. All typed in message so watch typos.

\\\
Dim myfilenameB as string = "BkupTblb" & Now.tostring(MMddyy) & ".xml"
dim myfilenameA as string = "BkupTbla" & Now.tostring(MMddyy) & ".xml"

if file.exist(myfilenameB) then
File.delete(myfilenameB)
end if
file.move(myfilenameA, myfilenameB)
file.copy(myoriginal, myfilenameA)
///
In this the B is deleted,it is up to you if you want that or to do something
else with it.

I hope this helps?.

Cor



 
Reply With Quote
 
Wayne Wengert
Guest
Posts: n/a
 
      13th Aug 2004
Thanks again Cor;

I'll adapt that to my situation

Wayne


"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Wayne,
>
> The same simplicity I assume you have an existing one you want to protect,

a
> good idea with a XML file. All typed in message so watch typos.
>
> \\\
> Dim myfilenameB as string = "BkupTblb" & Now.tostring(MMddyy) & ".xml"
> dim myfilenameA as string = "BkupTbla" & Now.tostring(MMddyy) & ".xml"
>
> if file.exist(myfilenameB) then
> File.delete(myfilenameB)
> end if
> file.move(myfilenameA, myfilenameB)
> file.copy(myoriginal, myfilenameA)
> ///
> In this the B is deleted,it is up to you if you want that or to do

something
> else with it.
>
> I hope this helps?.
>
> Cor
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel failed to copy properly HTML Table had to copy 1st to word T John Doe Microsoft Excel Crashes 1 3rd Dec 2009 07:44 AM
Search one table to copy and paste select data to another table Sarah Microsoft Access VBA Modules 1 12th Dec 2008 06:42 PM
SQL Query to copy Data from One Table to another Table having same names but from different databases apurv.agarwal@gmail.com Microsoft Access Queries 1 20th Nov 2006 05:54 PM
Make Copy of file in one table & copy it to another table =?Utf-8?B?VGVycnk=?= Microsoft Access 5 26th Oct 2006 07:56 PM
Copy/Paste does not copy a table from Access to SQL Server =?Utf-8?B?RnhKaW0=?= Microsoft Access 1 20th Sep 2006 07:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:56 PM.