473,503 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy a Table

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
Nov 21 '05 #1
4 1151
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
Nov 21 '05 #2
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" <no**********@planet.nl> wrote in message
news:Ol**************@TK2MSFTNGP09.phx.gbl...
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

Nov 21 '05 #3
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

Nov 21 '05 #4
Thanks again Cor;

I'll adapt that to my situation

Wayne
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:u1**************@TK2MSFTNGP12.phx.gbl...
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

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
10912
by: news.hp.com | last post by:
I have situation where I need to copy multiple records (only certain fields) from a Rules table to an Events table based on a selection identified in a combo box. When the selection is made in a...
3
8337
by: Tlm | last post by:
Hello All, I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also has a subform embedded in it (SubFrmC) The form's recordsource is based on a table (TblA). SubFrmB's...
19
3442
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
7
11600
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
2
2644
by: Janning Vygen | last post by:
hi PGurus, i searched the archives and read the docs, because this problem shouldn't be new. But i really don't know what to search for. i am populating a database (v7.4.1) with COPY. Some...
2
4802
by: Clodoaldo Pinto Neto | last post by:
Hi all, I'm trying to copy a table with a text field column containing a new line char to a file: ksDesenv=# create table page(line text) without oids; CREATE TABLE ksDesenv=# insert into...
2
2461
by: Marcin Zmyslowski | last post by:
Hello all! How to copy a table in MS SQL Server 2000 without chaning a structure? I mean, I have one table, which has autoincrement numeric field (ID). When I copy this table by exporting this...
2
3445
by: Swinky | last post by:
I hope someone can help...I feel like I'm walking in the dark without a flashlight (I'm NOT a programmer but have been called to task to do some work in Access that is above my head). I have...
4
4960
by: Jim Devenish | last post by:
I wish to copy a table on a SQL Server backend to a table on an Access (.mdb) front end in the simplest way. I have the following to get the recordset but am seeking something easier. Dim...
9
15100
by: fniles | last post by:
I would like to copy a table(s) from SQL Server 2005 to a CVS file and vice versa. I was thinking to use the BCP command line utility, but I have a few questions: 1. The machine where I am...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.