disk

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

Guest

How do I append data from a table found in a floppy disk to another database
table.
The source table(the one in the floppy) called batch.dbf contains new record
which need to be appended to another table called
tblbatch(path=c:\mydocument\batch.dbf).

Right now I use an append query, but both tables reside in the same
database. I am not sure how to do for the above said situation

Cheers!!
 
If you're talking about two tables contained in two .dbf files, you
could just copy the file from the floppy disk into the same folder as
the 'destination' .dbf file, and then use an append query as now.

Otherwise, more information is needed. Are you accessing the .dbf files
via linked tables, or are you using IN clauses in the query?
 
I am writing a label printing system in access VBA. Everyday new batches
have to be entered to a table called tblBatch. The new records are actually
appended from a dbase III dbf called Batch1 (lets refer it as the source).

Currently I import this source(Batch1) dbase III file from a diskette to my
access database using the menu commands. I import the source as a text file
and then use the following query to append record.

INSERT INTO tblbatch ( Batch_No, Part_No, Descrip, Unit, PDate )
SELECT BATCH1.BATCH_NO, BATCH1.PART_NO, BATCH1.DESCRIP, BATCH1.UNIT,
BATCH1.DATE FROM BATCH1;

BATCH 1 is the source, and tblbatch is the destination.
 
I don't know what you mean by importing a DBF file as a text file.

To import or link a dBASE III file in VBA, use DoCmd.TransferDatabase
with a DatabaseType of "dBase III".

Then you can run your existing append query with (among other
possibilities) this, where XXX is the name of the saved query:

DBEngine(0)(0).Execute "XXX", dbFailOnError
 
Dear John

When I say I am currently importing what I mean is I use the menu:

File > Get External Data > Import

Then I select the dbase 111 file from the disk (floppy)

MS Access then includes this dbase III file in my ms access data base. MS
Access includes this as a text file.

(For my query the above file is a source to append to the tblbatch table.)

So I wanted to know how to automate the above process to get this dbase III
file as a table to my MS Access.
 
I still don't understand what you mean by "MS Access includes this as a
text file."

When using File|Get External Data|Import to import a dBase III (.dbf)
file, one can import it into an existing table whose fields match those
of the dBase file, or into a new table (which Access will create) - but
neither of these things is a text file.

As I said before, to import a .dbf file under program control, use
DoCmd.TransferDatabase. See Help for the arguments it uses.

From what you say, you already have an append query that will move the
data from the imported table to your main table. You can execute this
under program control by using either
DBEngine(0)(0).Execute "XXX"
, where XXX is the name of the query, or
DoCmd.OpenQuery "XXX"
 
Thanks alot it worked!!

As I said before, to import a .dbf file under program control, use
DoCmd.TransferDatabase. See Help for the arguments it uses.

From what you say, you already have an append query that will move the
data from the imported table to your main table. You can execute this
under program control by using either
DBEngine(0)(0).Execute "XXX"
, where XXX is the name of the query, or
DoCmd.OpenQuery "XXX"
 
Back
Top