How to export an Access table to a binary file in Visual Basic 
Author Message
 How to export an Access table to a binary file in Visual Basic

Help!!!

How to export an Access table to a binary file in VB5?

Thanks.

Phong



Sun, 11 Mar 2001 03:00:00 GMT  
 How to export an Access table to a binary file in Visual Basic
You can read all the records in an array using the GetRows method and then write the array to a binary file. Here
an example (made in Access, so you'll have to change the databasename):

Sub ConvertToBinary()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim ar

  Set db = CurrentDb
  Set rs = db.OpenRecordset("Table1")

  With rs
    .MoveLast                   'To get the correct recordcount
    .MoveFirst
    ar = .GetRows(.RecordCount)
    .Close
  End With

  Open "tbldump.bin" For Binary As 1
  Put #1, , ar
  Close 1
End Sub


Quote:
> Help!!!

> How to export an Access table to a binary file in VB5?

> Thanks.

> Phong



Mon, 12 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Binary file access in visual basic.net

2. Binary Access File I/O Example for Visual Basic

3. Need Visual Basic help to export access record to text or html file template

4. Export Microsoft Access Database to Text File in Visual Basic Express

5. Importing Text file to Access Table in Visual Basic 5.0

6. MCP Needs help: Trying to list Imports/Exports table from Visual Basic

7. access table updated by Visual Basic passed on to visual Foxpro

8. accessing Access 7 tables with visual basic 4

9. exporting access queries to dbf in visual basic

10. Exporting out of Access Visual Basic and into MS-Word automatically

11. Visual Basic binary file format

12. Can Visual Basic controls be exported to Access?

 

 
Powered by phpBB® Forum Software