Adding records to a table (uber newbie question)

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

Guest

Howdy Al

I am using a flat file, downloaded from the internet, to update my database. I don't want my database to be updated from an improperly formatted flat file, so I do the initial editing and data storage into a recordset that is not connected to my database. Once the flat file is completely edited and I'm certain that it has the expected number of records, then I'd like to add those records to a table in the database. (The recordset and the table both have the same number of columns and column formatting).

Is there an straightforward way to do this? Right now I'm looping through the recordset and using AddNew to create new records in the database, one field at a time. It is a workable solution, but it seems a little laborious

Marty
 
I think I got it, at least I'm in the middle of testing the following notion

It is probably a mistake to think that you have to have a recordset to update a table. Instead, I'm trying to use an SQL "INSERT INTO" statement executed via a command object. Sounds plausible to me, but then again...
 
Marty

Yes, that's how I would do it. Possibly the simplest approach is to make an Append Query, and then run this query, either in a macro using the OpenQuery action, or in a VBA procedure, as you seem to be referring to

--
Steve Schapel, Microsoft Access MV

----- Marty wrote: ----

I think I got it, at least I'm in the middle of testing the following notion

It is probably a mistake to think that you have to have a recordset to update a table. Instead, I'm trying to use an SQL "INSERT INTO" statement executed via a command object. Sounds plausible to me, but then again...
 
Back
Top