Re: Import data

From: Nick (anonymous_at_discussions.microsoft.com)
Date: 09/02/04


Date: Wed, 1 Sep 2004 22:24:41 -0700

Nikos,
I am transfering Txt file into an Access table. The
Table is identical to what is being imported. I have to
retain the last 30 days of date. The text file does have
a date field in it and because it is a txt file there are
some import filters being used. I'm thinking code must
look at what is being imported and 1. determine if it has
that date in it and if not import the file and 2. if the
date store in the Access database is the same as the file
to be imported and delete that date and replace it with
the update version.
I am using validation rules for the file upload and am
still receiving the warning message. How do I turn them
off?
Your help is much appreciated. I have had to think out
what I realy need. Thanks
>-----original Message-----
>Nick,
>
>How you retrieve the date from the file on the disk
depends on how you do
>the import:
>
>If the filename on the disk is always the same and the
file is a linked
>table in your database then things are simple; the
criterion on the date
>field in your Deelete query would be something like:
>DFirst("[DateFieldName]","LinkedTableName")
>
>If, on the other hand, you are doing a TransferText,
then I can think of
>three options:
>(a) use code to read the date directly from the text
file, so you can use it
>in the criterion in the Delete query, or
>(b) link the text file even if just for the purpose, so
you can use the
>DFirst like before, or
>(c) do the import in a temporary table (delete
everything in it before the
>import), then use a DFirst on it for the Delete query,
then use an Append
>query to transfer the records from the temp table to the
final one.
>
>Note, all the above assumes there will ever only be one
date's worth of data
>on the disk.
>
>In order to suppress warnings / confirmation on action
queries (delete,
>append, update, make table) in a macro, use a
SetWarnings action with
>argument False. If you need to restore warnings within
the query (so, for
>instance, for getting a warning on another action query
that is run next)
>use another SetWarnings with argument True.
>
>HTH,
>Nikos
>
>
>
>"Nick" <anonymous@discussions.microsoft.com> wrote in
message
>news:048f01c48fbf$a1fdd930$a401280a@phx.gbl...
>> Nikos,
>>
>> There is a date field in the record and it would be
great
>> if I could up date any date without checking it. As
far
>> as the delete query it always ask if I want to
continue.
>> 1. How do I stop that? 2 How do you set up the read
>> statement? This sounds complicated. Please, Go step by
>> step. I am a little slow.
>> -----Original Message-----
>> >Nick,
>> >
>> >I suppose there is a date field in the records? Then a
>> quick and dirty way
>> >to do it would be to:
>> >1. Set-up a Delete query that deletes all records
where
>> date = today
>> >2. Set-up a simple macro that runs the delete query
>> first, then the Append
>> >one
>> >So you run the macro to update, and if there is
already
>> data for the day it
>> >is deleted first.
>> >
>> >If there is no date field, you will need to add one.
>> >
>> >It gets a little more complicated if you need to do
>> updates for a different
>> >date, in which case you would need a way to "read" the
>> date form the new
>> >record and pass it on to the delete query as a
>> parameter; not difficult,
>> >just an extra step in setting it up.
>> >
>> >HTH,
>> >Nikos
>> >
>> >"Nick" <vwcruzer@hotmail.com> wrote in message
>> >news:037a01c48c89$9c4ff330$a401280a@phx.gbl...
>> >> I import data from a disk daily and sometimes I
have to
>> >> import an updated version of information for the
same
>> >> date in the afternoon. I currently delete the
morning
>> >> data and import the afternoon updated version. Is
there
>> >> away to import without duplicating the information
or
>> >> have to go through the delete process.
>> >
>> >
>> >.
>> >
>
>
>.
>



Relevant Pages

  • Re: Import data
    ... To turn off the warning message: how do you do the import? ... > I am transfering Txt file into an Access table. ... >>If the filename on the disk is always the same and the ... >>import), then use a DFirst on it for the Delete query, ...
    (microsoft.public.access.macros)
  • Re: Membership database updates
    ... When you open any Query in Design View, click on the toolbar just next to ... black down-arrow where you can change your query to an Append or Update ... If you have any current members in your Import list, ... You mention Update Queries and Append Queries but I can't find how to ...
    (microsoft.public.access.tablesdbdesign)
  • RE: Assign macro on After update event
    ... I don't see why you can't append the current record next scheduled date to ... it then try using an update query to update the dates in the new record. ... "Anna" wrote: ... maybe you can help me with that: all this macro is ...
    (microsoft.public.access.forms)
  • Re: duplicates query help & strategy for update queries with SetWarnings = False
    ... I have many many queries that check for orpaned data (for example, if there's a billing record with no matching custID in the customer table, I'm putting up a form with the unmatched data, and a quick way to update all unmatched to one archive type customer, etc. ... I was surprised to see duplicate entries in some of the static tables for dropdown selections, so I have to solve this one now. ... Once the user has handled all the problems, you enable the final command button at the bottom of the form, which executes an append query to add the data to the real table. ...
    (comp.databases.ms-access)
  • Re: Append Query Date Criteria Problem.
    ... Why can't I append some records? ... Choose Parameters on the Query menu. ... Access opens the paramters dialog. ... > End Sub ...
    (microsoft.public.access.queries)