PDA

Click to See Complete Forum and Search --> : .dbf to .mdb in Visual Basic?


jenkinsp
May 1st, 2000, 08:03 PM
I'm a little stuck with a new project I have undertaken, and I hope that there is a really simple solution......

I have to write an application where I receive a .dbf database file, and I want to convert it (transfer the data) to an access .mdb database.

Is there a simple way to do this in VB?

phil

Glenn
May 1st, 2000, 09:54 PM
You should be able to open both databases from VB and simply transfer the data from one table to another.

Open a connection to both databases.

Select from the .dbf table

For each record
Insert into mdb file
next

This isn't elegant, but it should work.

Clunietp
May 1st, 2000, 10:58 PM
FYI:

DBF files are tables, where MDB files are databases (which contain many tables), so you'll have to have an existing MDB file to import it into...

here is an example how to connect to a DBF file:
http://forums.vb-world.net/showthread.php?threadid=10239

As Glenn said, just loop thru the recordset and add new records to your Access table

lychew
May 2nd, 2000, 01:32 PM
Create a DSN to the dbf file and another to the mdb file and write codes to transfer.