473,652 Members | 3,173 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 1155
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(MM ddyy) & ".xml"
myds.writeXML(m yfilename)
myfilename = "BkupTblb" & Now.tostring(MM ddyy) & ".xml"
myds.writeXML(m yfilename)

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**********@p lanet.nl> wrote in message
news:Ol******** ******@TK2MSFTN GP09.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(MM ddyy) & ".xml"
myds.writeXML(m yfilename)
myfilename = "BkupTblb" & Now.tostring(MM ddyy) & ".xml"
myds.writeXML(m yfilename)

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(MM ddyy) & ".xml"
dim myfilenameA as string = "BkupTbla" & Now.tostring(MM ddyy) & ".xml"

if file.exist(myfi lenameB) then
File.delete(myf ilenameB)
end if
file.move(myfil enameA, myfilenameB)
file.copy(myori ginal, 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**********@p lanet.nl> wrote in message
news:u1******** ******@TK2MSFTN GP12.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(MM ddyy) & ".xml"
dim myfilenameA as string = "BkupTbla" & Now.tostring(MM ddyy) & ".xml"

if file.exist(myfi lenameB) then
File.delete(myf ilenameB)
end if
file.move(myfil enameA, myfilenameB)
file.copy(myori ginal, 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
10925
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 parent table, multiple records in a child table are affected. However, I'm a bit weak on programming experience. INSERT INTO is not suitable. Any ideas? When the combo box update property is triggered, the code needs to accomplish: IF...
3
8355
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 recordsource is also based on a table (TblB). SubFrmC's recordsource is also based on a table (TblC). There is a one-to-many relationship between TblA (one) and TblB (many).
19
3463
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
11613
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 is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an OpenFileDialog: Dim result As DialogResult = Pic_Sel.ShowDialog() If (result = DialogResult.OK) Then
2
2658
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 triggers in the db schema fire on inserts and do some additional data manipulations, which i dont want to take place by running COPY because my data don't need those additional manipulation. Therefor and for performance reasons, i disable all...
2
4825
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 page (line) values('1stline'||chr(10)||'2ndline'); INSERT 0 1
2
2467
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 table into the same database folder I loose the specification of the field ID. Now it is not autoincrement field but usual int field. Is it possible to copy this table without changing data and structure of a table? Kindest regards
2
3461
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 code that will successfully copy a record and append the information to a new record in the same table (parent table) within a form. However, there are related child tables with primary keys (set to Autonumber) stored in sub-forms. That information...
4
4966
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 theConnectionString theConnectionString = "Driver=SQL Server; Server=Server;Database=myData;Trusted_Connection=Yes"
9
15139
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 going to run BCP utility does not have SQL Server installed, so BCP.exe and its underlying DLLs are not there. I copied BCP.EXE, then it tells me that it expects sqlncli.dll. After I copied that DLL, it now says "Unable to load BCP resource DLL. BCP...
0
8367
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8279
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8467
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4145
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2703
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 we have to send another system
1
1914
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.