View Full Version : Importing text problem


cyperpc
12-14-2003, 05:21 PM
My Access database has about 25+ tables. I export data from Oracle to a TEXT file and then have MS Access import the data to tables. Example of one TEXT file would be the Home Address file with has First Name, Last Name, Home Street Address, City, State, Zip, and SSAN. To update this data I have MS Access runs a Marco that first delete the Home Address table and then imports the new HomeAddress.txt . This works great if I want to replace the file. But sometime I need the file that I am importing to just append the data to the table (just add it to the end) and sometimes I need the data refresh the table (just replace the items or fields that are new or have changed since the last update). How do I get my Marco to do this?

FoFa
12-15-2003, 06:14 AM
Usually I read the Oracle tables directly rather than export and import. But if that is what you need the problem lies in using a direct import. Most important, you need a KEY most likely what ever Oracle is using. Once you have that, then you import the text into a work table. Then you can design an update query and an insert to run the data from the work table to the "real" table by using the KEY to match on for update, and detect does not exist for insert. You can control that from a macro.

cyperpc
12-15-2003, 08:31 AM
Thanks for your replay! I was reading more last not and fig I would have to do something with the Update Queries. I have access to Oracle but the users do not. I have to run the reports and send it to the users. This is way I am putting the data in Access then the user can run their reports any time they what. I refresh the Access Data daily.

FoFa
12-15-2003, 10:57 AM
Here is a thought, you can create a APP userid/password on your Oracle system that has limited access (like SELECT only) to the data, and hard code that in a SQL PASSTHROUGH query. Then you can use the SQL PASTHROUGH query as the source of the users data. Then the actual users do not individual access to Oracle. Unless there are network issues and it is a great amount data, should not be that big of a deal.