Import Data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am running a Windows XP Pro and Office XP Pro machine with Microsoft Access
2002. I currently use a database to import records from a web based database
by saving downloads as .csv files, converting to excel, cleaning up the data,
and then importing the Excel File via VBA Code, and macros stored in some MS
Excel templates.

My table structure is such. tblProperty contains property records and tblTax
contains the cooresponding tax records for those properties. Each day I
download a list of properties some are new records and others are records
that have changed. Presently the changed records are not imported because
they create a duplicate in my primary key field which isn't allowed.

I would like to be able to import the information each day and if there is a
changed record (a record with the same primary key already exists in the
table), I would like to delete the old record, and then import the new. The
ideal scenario would delete all fields with the exception of the primary key
field and one other (the field that I use to relate tblProperty and tblTax).

Could someone please point me in the right direction?
 
The usual technique is

1) Link the external data as a temporary table.

2) Update existing records with an update query that joins the temporary
table and the existing one on the primary key field.

3) Append new records with an append query. You can just allow the
system to reject duplicate primary key values - but if this bothers you,
you can filter out the duplicates with a WHERE clause in the query.
 
Back
Top