A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding only new records from another database



 
 
Thread Tools Display Modes
  #1  
Old August 19th, 2006, 06:21 PM posted to microsoft.public.access.gettingstarted
Nir N
external usenet poster
 
Posts: 14
Default Adding only new records from another database

I have created a customers table that feeds from another Acesss database's
customer list table.
The other database is constantly being updated -new records (customers) are
added daily.
I need to periodically scan this "foreign" database and add only new
records to my own database (to keep the two tables synchronized in some
fields only).
How can it be done?

Thanks!
  #2  
Old August 19th, 2006, 08:45 PM posted to microsoft.public.access.gettingstarted
Claes D
external usenet poster
 
Posts: 13
Default Adding only new records from another database

How do you transfer the records?
Code or manually?
Im a newbie too, but I would create a new field in the table (in the
"foreign" database) that shows if the records have been transferred.
Then create an update query that sets todays date in the new field. (if the
value is Null.)
The query should run after transfer.

This should work regardless of how you transfer the records.

/Claes


"Nir N" skrev:

I have created a customers table that feeds from another Acesss database's
customer list table.
The other database is constantly being updated -new records (customers) are
added daily.
I need to periodically scan this "foreign" database and add only new
records to my own database (to keep the two tables synchronized in some
fields only).
How can it be done?

Thanks!

  #3  
Old August 20th, 2006, 05:34 AM posted to microsoft.public.access.gettingstarted
Nir N
external usenet poster
 
Posts: 14
Default Adding only new records from another database

Thanks for your suggestion.
I can use either an update query or code. However I cannot modify the
"foreign" database as it is a 3rd party, read-only Access program. Therefore
I need to check for duplicate records at the level of the "receiving" table
/ form.

Nir

"Claes D" wrote:

How do you transfer the records?
Code or manually?
Im a newbie too, but I would create a new field in the table (in the
"foreign" database) that shows if the records have been transferred.
Then create an update query that sets todays date in the new field. (if the
value is Null.)
The query should run after transfer.

This should work regardless of how you transfer the records.

/Claes


"Nir N" skrev:

I have created a customers table that feeds from another Acesss database's
customer list table.
The other database is constantly being updated -new records (customers) are
added daily.
I need to periodically scan this "foreign" database and add only new
records to my own database (to keep the two tables synchronized in some
fields only).
How can it be done?

Thanks!

  #4  
Old August 20th, 2006, 12:32 PM posted to microsoft.public.access.gettingstarted
Brendan Reynolds
external usenet poster
 
Posts: 1,241
Default Adding only new records from another database

Here's an example I posted recently in answer to a similar question ...

INSERT INTO TargetTable (TargetID, TargetText) SELECT SourceID, SourceText
FROM SourceTable WHERE SourceID NOT IN (SELECT TargetID FROM TargetTable)

Here 'SourceID' is the primary key of the table you're copying from, and
TargetID is the primary key of the table you're copying to.

--
Brendan Reynolds
Access MVP

"Nir N" wrote in message
...
Thanks for your suggestion.
I can use either an update query or code. However I cannot modify the
"foreign" database as it is a 3rd party, read-only Access program.
Therefore
I need to check for duplicate records at the level of the "receiving"
table
/ form.

Nir

"Claes D" wrote:

How do you transfer the records?
Code or manually?
Im a newbie too, but I would create a new field in the table (in the
"foreign" database) that shows if the records have been transferred.
Then create an update query that sets todays date in the new field. (if
the
value is Null.)
The query should run after transfer.

This should work regardless of how you transfer the records.

/Claes


"Nir N" skrev:

I have created a customers table that feeds from another Acesss
database's
customer list table.
The other database is constantly being updated -new records (customers)
are
added daily.
I need to periodically scan this "foreign" database and add only new
records to my own database (to keep the two tables synchronized in some
fields only).
How can it be done?

Thanks!



  #5  
Old August 20th, 2006, 04:50 PM posted to microsoft.public.access.gettingstarted
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default Adding only new records from another database

Provided both the source and target tables have a primary key, e.g.
CustomerID you can simply attempt to insert all rows from the source table.
Those already represented in the target table will be rejected by virtue of
the key violations, and only the new rows inserted.

The mechanics for importing the data are simply to create a link to the
source table in the target table, and base an 'append' query on this linked
table, setting it up to append to the target table. If you run the append
query via the user interface you will get a message telling you that n number
of rows were not appended due to key violations.

Ken Sheridan
Stafford, England

"Nir N" wrote:

I have created a customers table that feeds from another Acesss database's
customer list table.
The other database is constantly being updated -new records (customers) are
added daily.
I need to periodically scan this "foreign" database and add only new
records to my own database (to keep the two tables synchronized in some
fields only).
How can it be done?

Thanks!


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.