PDA

View Full Version : Automatic data exporting from one Access file to another



Lammutaja
07-12-2005, 07:42 AM
Hi!
Can someone please help me in next problem:

I have two Access files. Let us name them A and B
I am filling A with data (3 tables) from Excel (with ADO).
The structure of these tables are the same for files A and B.

I have to export (in each morning for example or
by some another event) new data from file A to B automatically
(each table in file A has field "Export" and when data has not yet exported to B the value of "Export" is "No"; After exporting the data the value of the field "Export" will be "Yes").
How can I export the data with VBA automatically from file A to B when
some event occures?:dunno

J?ri.

xCav8r
07-12-2005, 03:58 PM
You can use ADO or DAO to read and write from A to B when some event occurs.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovrchoosingadoordaoforworkingwithaccessdatabases.asp

Lammutaja
07-12-2005, 10:56 PM
Thank You.
Can You please specify, how i can make a procedure for event?
For example, my procedure will be executed each morning at 8.30 without
opening Access file?

J?ri.

xCav8r
07-13-2005, 05:45 AM
The simplest solution would be to use the task scheduler to open your your database at 8.30 which contains an autoexec macro that exports the data and then closes when it's done. If you really don't want to open it, you could use VBS and ADO/DAO to transfer the data, but you'd need to run that via the task scheduler as well. My recommendation, however, is to go the VBA route since it's easier.