473,466 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Copy queries between Access DBs with Module

Is it possible to automate the process of copying queries from one
Access database into another using a Module? If so could anyone give
me a pointer as to how this might be achieved.

TIA,

Colin
Nov 12 '05 #1
3 5865
Check DoCmd.TransferDatabase

--
Wayne Morgan
MS Access MVP
"Colin Steadman" <go****@colinsteadman.com> wrote in message
news:40**************************@posting.google.c om...
Is it possible to automate the process of copying queries from one
Access database into another using a Module? If so could anyone give
me a pointer as to how this might be achieved.

Nov 12 '05 #2
Public Sub ExportAllQueries()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Const strDestDB as String = "F:\SaveUs\ShowCourses.mdb"
Set db = CurrentDb
For Each qdf In db.QueryDefs
DoCmd.TransferDatabase acExport, "Microsoft Access", _
strDestDB, acQuery, qdf.Name, qdf.Name
Next qdf

Set qdf = Nothing
Set db = Nothing

Debug.Print "done exporting Queries..."
End Sub
Nov 12 '05 #3
> Public Sub ExportAllQueries()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Const strDestDB as String = "F:\SaveUs\ShowCourses.mdb"
Set db = CurrentDb
For Each qdf In db.QueryDefs
DoCmd.TransferDatabase acExport, "Microsoft Access", _
strDestDB, acQuery, qdf.Name, qdf.Name
Next qdf

Set qdf = Nothing
Set db = Nothing

Debug.Print "done exporting Queries..."
End Sub

Thankyou! This looks looks like it does exactly what I trying to do.

Colin
Nov 12 '05 #4

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

Similar topics

1
by: Chip | last post by:
Just installed Access 2000 on a new WinXP computer and imported (converted) a single user Access 97 database. When I try to manually "copy" a record, the "cut", "copy", and "paste" options...
1
by: deko | last post by:
DoCmd.CopyObject copies data, but I only need structure. I'm trying to clone several tables in my Access 2003 mdb. The goal is to link to a series of Excel spreadsheets and then run various...
2
by: Aaron Haspel | last post by:
Greetings Access gurus. I have clients with Access databases in the field that I need to update -- new tables, new indices, new queries, the works. Since these clients may have only the Access...
1
by: bbcrock | last post by:
I have an employee who created 70 queries in MS Access 97. I want to export all these queries into plain-text SQL statements at one time. A coworker in charge of Access said the only way is to...
11
by: Danny J. Lesandrini | last post by:
Has anyone else noticed this? I searched group archives and found nothing, but it's really starting to irritate me big time. Here's the steps to reproduce the problem: Copy something to the...
11
by: DFS | last post by:
Architecture: Access 2003 client, Oracle 9i repository, no Access security in place, ODBC linked tables. 100 or so users, in 3 or 4 groups (Oracle roles actually): Admins, Updaters and ReadOnly....
4
by: Mark | last post by:
Good morning. I recently made some changes to my Access project, and I introduced some problems that I could not resolve. So I deleted the forms that I had altered and saved the project. Then I...
3
by: yoma | last post by:
python version 2.5 in module copy we all know that copy have two method: copy() and deepcopy(). and the explain is - A shallow copy constructs a new compound object and then (to the extent...
4
by: labmonkey111 | last post by:
The company I work for uses a very large program in Access/VBA. Whenever I edit it, I copy the latest edition to my harddrive and make the necessary changes, then copy the modified...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.