473,608 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2280
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******** *************@n ews.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*****@localh ost.not> wrote in message
news:bQ******** ********@nwrddc 03.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******** *************@n ews.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
2391
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 transaction I need to be able to select records changed by an update statement made earlier within the same stored proc (and within the same transaction) and need for that select to reflect the changed values.
3
2703
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 SqlConnection(ConnectionString) con.Open() Dim daProductsDS As New SqlDataAdapter("Select * from ProductsDS", con) Dim oCommandBuilder As New SqlCommandBuilder(daProductsDS)
4
2572
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. same setup on each web server. I have an application that is mapped to a network folder, physically located on a file server , also Win2K. on each web server, the root level of the application, directly located
1
1876
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 and then have mysql do them all?? IE : query.txt insert into table1 (col1,col2) values (1,2);
0
1899
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 be the "BEST" method. Scenario: Every day I have a CSV file which is intended to both update and add records to a SQL table. There is a matching ID column in the CSV file and in the SQL table, when a match is made an update is performed,...
5
2579
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 server. So the files should not be in library.zip. I tried the --bundle option but apparently it can only be used to make the distribution __more__ bundled. Thanks,
0
1163
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 particular database is lost. After searching Google, I found a workaround to this. If I exclude the database file from the update, everything is fine, kind of. The problem is, if I exclude the database file from future updates, then if someone...
1
1321
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 Updates (allows the site to find, download and install high-priority updates for your computer) Background Intelligent Transfer Service (BITS) (helps updates download more quickly and without problems if the download process is interrupted)...
0
1756
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 launcher/updater app, no registry entries. -App to automatically check for updates, ask permission from user, update app, and relaunch.(if necessary) I've never done this before, so I don't know the correct way to go about this, and my...
0
8000
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
8495
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...
0
8470
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6815
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5475
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
3960
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...
0
4023
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1328
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.