473,416 Members | 1,871 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,416 software developers and data experts.

Want updates in .mdb file to update other .mdb file too


Please help. I have two databases - one I'm designing that will be our
in-house data mgmt system (db1) and another that is a federally-mandated
system (db2). We must submit data from db2 but don't want to use this db
for our data mgmt needs. Some of the fields in db1 are shared with db2
but the structure and field names are different. When I'm
updating/creating records in db1 I want it to see if the record exists
in db2 (shared ID number), if not, create a record, then populate those
fields that are shared between the two databases (so that I only have to
enter data in db1). I need it to update in real time because
occasionally I will use db2 to enter additional data not captured in
db1. Note that db2 is a national standard and while it can be
revised/edited for in-house use, it's best not to. All code I might
write to perform this task needs to "live" in db1.

I'm new to VBA and advanced Access techniques so I don't know where to
begin. Thanks!!!

Heather
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
4 2262
You can obtain an ODBC driver for DB2, and link the tables. You can create a
Query that will join the corresponding tables, set the join parameters so
that you return "all the records from the DB2 table and only those that
match from the MDB table", with criteria of Null on some critical field
(such as the primary key) of the MDB table. Then use that Query as the data
source of an Append Query to add the records to the MDB table. If you have
also retrieved the pertinent shared fields, they will be set when the record
is added.

You can execute the queries from code that runs at startup, so it will be
"semi-automatic". I suppose if you wanted it "fully automatic", you could
create an Access database with startup code, and schedule it to be run by
the Windows Scheduler -- that's a question for someone more knowledgeable
about the Windows Scheduler than I am.

Larry Linson
Microsoft Access MVP
HEATHER CARTER-YOUNG" <he******************@nps.gov> wrote in message
news:40*********************@news.newsgroups.ws...

Please help. I have two databases - one I'm designing that will be our
in-house data mgmt system (db1) and another that is a federally-mandated
system (db2). We must submit data from db2 but don't want to use this db
for our data mgmt needs. Some of the fields in db1 are shared with db2
but the structure and field names are different. When I'm
updating/creating records in db1 I want it to see if the record exists
in db2 (shared ID number), if not, create a record, then populate those
fields that are shared between the two databases (so that I only have to
enter data in db1). I need it to update in real time because
occasionally I will use db2 to enter additional data not captured in
db1. Note that db2 is a national standard and while it can be
revised/edited for in-house use, it's best not to. All code I might
write to perform this task needs to "live" in db1.

I'm new to VBA and advanced Access techniques so I don't know where to
begin. Thanks!!!

Heather
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #2
HEATHER CARTER-YOUNG wrote:
Please help. I have two databases - one I'm designing that will be our
in-house data mgmt system (db1) and another that is a federally-mandated
system (db2). We must submit data from db2 but don't want to use this db
for our data mgmt needs.


As someone else already addressed your main question, I justed wanted to
note this as an aside. I'm assuming that you named them db1 and db2
just for illustrative purposes in your post - if they're both Access
databases and actually named db1 and db2, I would recommend that you
select different (and more descriptive) names for them. The reason for
this is that by default, Access names new databases you create db1, then
db2, then db3, etc. We had a post not long ago from someone who put
hundreds of hours of work into a database, but he had not remembered to
rename it from db8. After some time away, he came back and deleted all
his "temporary" Access databases and accidently deleted the one he had
put all that time into.

Nov 13 '05 #3
Oops. I think I misread... I assumed you were talking about the IBM DB2
product, but perhaps you just meant a "second Access database"?

If, by "db2", you did mean "second Access database", then you need no ODBC
driver to link the tables... you can do that directly from Access.

I agree with John... it is much better to have descriptive names for your
databases... but I am not sure your post implied that they were actually
named "db1.mdb" and "db2.mdb" on your machine.

Larry Linson
Microsoft Access MVP
"Larry Linson" <bo*****@localhost.not> wrote in message
news:bQ****************@nwrddc03.gnilink.net...
You can obtain an ODBC driver for DB2, and link the tables. You can create a Query that will join the corresponding tables, set the join parameters so
that you return "all the records from the DB2 table and only those that
match from the MDB table", with criteria of Null on some critical field
(such as the primary key) of the MDB table. Then use that Query as the data source of an Append Query to add the records to the MDB table. If you have
also retrieved the pertinent shared fields, they will be set when the record is added.

You can execute the queries from code that runs at startup, so it will be
"semi-automatic". I suppose if you wanted it "fully automatic", you could
create an Access database with startup code, and schedule it to be run by
the Windows Scheduler -- that's a question for someone more knowledgeable
about the Windows Scheduler than I am.

Larry Linson
Microsoft Access MVP
HEATHER CARTER-YOUNG" <he******************@nps.gov> wrote in message
news:40*********************@news.newsgroups.ws...

Please help. I have two databases - one I'm designing that will be our
in-house data mgmt system (db1) and another that is a federally-mandated
system (db2). We must submit data from db2 but don't want to use this db
for our data mgmt needs. Some of the fields in db1 are shared with db2
but the structure and field names are different. When I'm
updating/creating records in db1 I want it to see if the record exists
in db2 (shared ID number), if not, create a record, then populate those
fields that are shared between the two databases (so that I only have to
enter data in db1). I need it to update in real time because
occasionally I will use db2 to enter additional data not captured in
db1. Note that db2 is a national standard and while it can be
revised/edited for in-house use, it's best not to. All code I might
write to perform this task needs to "live" in db1.

I'm new to VBA and advanced Access techniques so I don't know where to
begin. Thanks!!!

Heather
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 13 '05 #4
HEATHER CARTER-YOUNG wrote:
Please help. I have two databases - one I'm designing that will be our
in-house data mgmt system (db1) and another that is a federally-mandated
system (db2). We must submit data from db2 but don't want to use this db
for our data mgmt needs. Some of the fields in db1 are shared with db2
but the structure and field names are different. When I'm
updating/creating records in db1 I want it to see if the record exists
in db2 (shared ID number), if not, create a record, then populate those
fields that are shared between the two databases (so that I only have to
enter data in db1). I need it to update in real time because
occasionally I will use db2 to enter additional data not captured in
db1. Note that db2 is a national standard and while it can be
revised/edited for in-house use, it's best not to. All code I might
write to perform this task needs to "live" in db1.

I'm new to VBA and advanced Access techniques so I don't know where to
begin. Thanks!!!

Heather


An Access database consists of objects; tables, queries, forms, reports,
macros, and modules.

Oftentimes people store all of their queries, forms, reports, macros,
and modules in one mdb (Access database). This is often times called
the front end. Another database may exist and all tables (data) are
stored in that database. This is called the back end.

If you want, you can store all objects in one mdb.

Anyway, from your front end mdb (db1) you would link to the tables in
the back end for your db1 tables if you decide to split into front/back
ends. From the db1 frontend you would also link to tables in db2. How
do you link?

From the menu, select File/GetExternalData/Link. A FileOpen dialog is
presented. Select the back end to link. Then select all tables to be
linked and press OK or Link.

Let's say DB1 has a table called Orders and DB2 has a table called
Orders. If you link to Orders in DB1, when the link is created, the
name will be Orders. If you link to Orders in DB2, when the link is
created, the table name will be Orders1. I would recommend that YOUR
table names in DB1 be different than table names in DB2. In this
example, you would name your Orders table in DB1 something like
OrdersDB1. This way you'll be able to differentiate which database the
link is pointing to.

The first thing you need to master are queries, then forms. I would
play around with the query builder. Try out the wizards. (Query/New).
Click Help from the menu and read as much as you can on Queries.
The real power of databases comes from your ability to create queries.

You can create forms too using wizards.

If you are new to Access and not a programmer, many things can be done
with macros. They are straightforward and provides a lot of power to
non-programmers. Read up on them. If you are on a row when creating a
macro you can always press F1 to get more info.

If you hang out here and lurk and read posts, you'll get a tremendous
amount of information. Lots of code examples are provided in these
threads and sooner or later you'll be answering questions for others
instead of asking them.

You might want to have a handy book around. I suggest going to Amazon
and searching for books on MSAcess. Look for books that are for
beginners and intermediates. Read the reviews. Pick on that seems to
cover the subject well and have a high reviewer rating with lots of reviews.

Good luck.

Nov 13 '05 #5

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

Similar topics

2
by: M Wells | last post by:
Hi All, This seems like a tricky question to me. I have a Stored Procedure that encapsulates a number of updates to various tables within a transaction. However, at a later part of the...
3
by: Vijay Balki | last post by:
This might be a dumb question to ask. Can someone answer me with patience.. When I have a typed or un-typed dataset, the only way I can update is like below? Dim con As New...
4
by: Jerome Cohen | last post by:
This problem is driving us mad, and I saw someone else posting a very similar problem, again no support from MS! ----------------------- Win2K/IIS 5.0, web farm load balanced by Local director....
1
by: Craig Stadler | last post by:
Using mysql 4.0.23- What is the best way to execute several (hundreds of) inserts and updates? Rather than issuing tons of individual inserts and updates, can I send the strings to a text file...
0
by: Eric Paul | last post by:
I have been in search of a better way to handle bulk inserts and updates into SQL 2000 using c# and while I have found a few different ways to accomplish this I was wondering what is considered to...
5
by: Laszlo Nagy | last post by:
Hi, I want py2exe not to create library.zip. My reason is that the installed program will be a self updating program, and it must be able to download changes (newer python source files) from the...
0
by: andrewschools | last post by:
Hi, I'm using ClickOnce for all of my installations and updates. However, when I modify any of the datasets in my application, when a user downloads the new update, all their data saved in their...
1
by: =?Utf-8?B?bmVpbG9scw==?= | last post by:
Everytime I reboot my computer I get a baloon pop up that says Automatic Updates is turned off. When I try to manualy update Windows I get the following message from Internet Explorer. Automatic...
0
by: Mogrin | last post by:
So I have this windows .net form app, and I have the following goals: -Needs to be 1 single file, the executable, in any directory the user decides to download it to. No installation folder, no...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...

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.