Re: how to read dbf file using macro?



This is from the database side.
In Access:
Set up a simple select query that selects all the appropriatedbf data
Let's say that you name it qryDBFDataForExcel
Lets say you want to export the dbf data to an Excel spread*** with the
path and name of "c:\MyDBFInWkBk.xls

DoCmd.TransferSpread*** acExport, 8, "qryDBFDateForExcel",
"c:\MyDBFInWkBk.xls"

The acExport tells it that the data is outbound.
The 8 tells it to create Excel version Ofc97 or later.
The "qryDBFDateForExcel" tells it which query or table to export data from.
The "c:\myDBFInWkBk.xls" tells it what workbook to create and place the data
in and where that workbook will be located.

You will then have a spread*** with the column titles from the DBF
fieldnames and all the data from DBF under the appropriate
Column titles.

You can modularize this by using variables to store the query and file names
and then process any number of DBFs to excel.

____________________________________________________________________

On the other hand if you only have one dbf and want all of the data in the
DBF you can open Excel.
Go to File: Open and double click on the DBF filename. That will open the
file in Excel. You can then save it as an Excel workbook.


"musa.biralo" <musa.biralo@xxxxxxxxx> wrote in message
news:1158283617.814295.127790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
i want to read each row of specific column of musa.dbf using macro
(VBA) in excel.
my main gole is to copy the data of dbf file to excel file.
I am new but want to do something..i tried and tried...and finally i am
here....
help me.

musa.biralo



.


Quantcast