473,386 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how can I run a code/macro in a different database

Hi there,

Can anyone tell me how I can run code/macro in a different database???
Below are the two situations where this may be applicable.

1. run a macro/code in another database that sends a file. I do not want
these tables/code/queries etc... to be part of my standard database, because
only some customers use this extension

2. close the current database, rename it and copy a new database (either
from an FTP or a server location) to the location and name of the one we
just closed.

TIA

- Nicolaas
Nov 13 '05 #1
3 6230
"WindAndWaves" <ac****@ngaru.com> wrote in message news:<cd*******************@news.xtra.co.nz>...
Hi there,

Can anyone tell me how I can run code/macro in a different database???
Below are the two situations where this may be applicable.

1. run a macro/code in another database that sends a file. I do not want
these tables/code/queries etc... to be part of my standard database, because
only some customers use this extension

2. close the current database, rename it and copy a new database (either
from an FTP or a server location) to the location and name of the one we
just closed.

TIA

- Nicolaas


Have you considered the possibility of having your Access DB use
Access Automation on the other Access DB?

James A. Fortune
Nov 13 '05 #2
no, how would i do that?

Thank you for your answer James
Nov 13 '05 #3
"WindAndWaves" <ac****@ngaru.com> wrote in message news:<Km*******************@news.xtra.co.nz>...
no, how would i do that?

Thank you for your answer James


Microsoft KB Article 222101:

http://support.microsoft.com/default...01&Product=acc

suggests resources for doing Automation. You need to see a picture of
Access' Object Model for the version of Access you are using. Allen
Browne's DAO Object Model image is also potentially useful:

http://members.iinet.net.au/~allenbrowne/ser-04.html

Automation should be able to handle the two cases you mention. For
2), you should grab the 'current database' from another database that
does the automation and handles closing it, renaming it, copying the
new one to the old location and opening the new one. If finding the
'current database' causes you trouble, try opening the 'current
database' originally from the other database and keep a handle of that
instance. Note that automating Access is trickier than automating
other Office products since they have the ability to record actions
and produce VBA code corresponding to those actions. Someone familiar
with coding VBA in Access should be able to figure it out anyway.

James A. Fortune
Nov 13 '05 #4

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

Similar topics

5
by: | last post by:
I have ASP code displaying currency datatype data from Access database. I have copies of this asp code and tha database on two w2k/IIS5 computers, bothg having the decimal symbol set to "." in...
62
by: SAN3141 | last post by:
There doesn't seem to be consensus about when to put code in the database or in the middle tier. There was a long discussion about this in an Oracle newsgroup (message ID:...
20
by: xixi | last post by:
hi, we use db2 udb v8.1 on windows, i am trying to use federated database objects to create wrapper, even though i have update dbm cfg using federated yes, i still get error "the instance for the...
2
by: Henriksen, Jonas F | last post by:
Hi, is it possible to write a trigger, using pl/pgSQL, that updates tables in a different database than the one the trigger is called from? If it is, what is the syntax for calling the other...
2
by: Coquette | last post by:
Hi all. I'm new here. I wanted to ask your opinion about *joining two tables* from *two different database* together. Is *that* possible? My project requires me to join identical tables from...
2
by: scott.alfon | last post by:
Hello, i need your help. I want to implement a php-script where I can access to different database types as PostSQL, MySQL etc. Is that possible? Furthermore I want to include an access...
2
by: ezly80 | last post by:
hai... i have problems to connect the jboss server with two different database which is Oracle and Mysql. this two db have same db name example Student. if one of the db corrupt the server can...
1
by: okonita | last post by:
Hi all, I have a need to copy data from one database/schema to a different database schema. Yes, I can use export/import but that is not "elegant". Yes, I can try a redirected Restore from Backup...
24
by: tokcy | last post by:
Hi everyone, I want to connect two different database server using php/mysql. Suppose i have some dat on www.xyz.com and i want to select that data on www.abc.com How do i integrate two...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
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,...

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.