Within an Visual Basic I want to be able to import a Fox Pro .dbf into an Access database. Does anyone have a code sample on this or any suggestions? Thanks...
I know Access can link to a Fox Pro table but I have to do it within Visual Basic code. The data from the Fox Pro table has to be imported into an Access table. It has to be done on a daily basis.
I have a VB program where I read from a FoxPro table and insert the data into a SQL Server db.
First, you need to create a foxpro data source on the machine running the app. That's what the <DataSourceName> is in the strConString variable. I made my datasource look in the root directory, that allows me to open any FoxPro table on that machine.
' Set a connection string
strConString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=<DataSourceName>"
' Create a recordset from the FoxPro data
Private Function OpenDBFile(strDBName As String) As ADODB.Recordset
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.