How can I read record from dBase IV (.DBF) with VB 6 
Author Message
 How can I read record from dBase IV (.DBF) with VB 6

HI,

I want to read record from a DBF file (dBase IV) and add this record
to a table in access (MDB). How can i do it? As soon as I tried to
open the DBF file a got this error message-> Invalid Path.
But the path is good.

I tried many thing, but did't make it work.

Here is a code that a tried:

Dim dbs as Database
Dim rst as Recordset

Set dbs = OpenDatabase("ENTBX.DBF", False, True, "dBase IV;C:\DBPATH")
Set rst = dbs.openrecordset

Could somebody help me with this?
Thank's

Nic



Tue, 29 Oct 2002 03:00:00 GMT  
 How can I read record from dBase IV (.DBF) with VB 6
Here's one I did earlier...... Obviously you'll need to change the table
names..

    Set tb = db.CreateTableDef("drg_main")
    tb.Connect = "dBase III;HDR=NO;IMEX=2;DATABASE=" & strPath
    tb.SourceTableName = "drg_main.dbf"
    db.TableDefs.Append tb

This way does work - you can then refernce the tabledef with a recordset
object as normal.

Cheers,

Davy


Quote:
> HI,

> I want to read record from a DBF file (dBase IV) and add this record
> to a table in access (MDB). How can i do it? As soon as I tried to
> open the DBF file a got this error message-> Invalid Path.
> But the path is good.

> I tried many thing, but did't make it work.

> Here is a code that a tried:

> Dim dbs as Database
> Dim rst as Recordset

> Set dbs = OpenDatabase("ENTBX.DBF", False, True, "dBase IV;C:\DBPATH")
> Set rst = dbs.openrecordset

> Could somebody help me with this?
> Thank's

> Nic



Tue, 29 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to delete a recordset of dBASE IV DBF file use VB4

2. DBASE IV Encrypted Database (.dbf)

3. diverting dBase IV data writes to dbf files to SQL7 tables

4. Read DBase IV files with VB 3.0 Prof.

5. Read DBase IV with VB 3.0 Professionnal

6. Reading fields from a dbase IV file

7. Can Ojects be stored in DBASE IV Record

8. Delete records when using dBase IV

9. How to read dBASE IV with ODBC 32?

10. Deleting records in dBase IV

11. Can't read DBase IV / FoxPro graphics with Jet 3.5

12. File/Record Locking in dBase IV DBs

 

 
Powered by phpBB® Forum Software