Re: Connect to Foxpro Data (*.DBF) in VB.Net



Hi Eric,

First of all, be sure you have the latest FoxPro and Visual FoxPro OLE DB
data provider, available from msdn.microsoft.com/vfoxpro/downloads/updates.
ODBC is an older technology and does not support all versions of FoxPro
tables.

FoxPro tables come in 3 parts: the DBF is the main table, the FPT (optional)
is the contents of Memo fields, and the CDX (also optional) is the
associated index file. All three of these generally named the same excepting
the extension and if your table has Memo fields and indexes then the FPT and
CDX must be present.

There are two ways Fox tables are organized. First, there are "free" tables.
With free tables a DBC file is not present and the connection string should
reference only the directory where the files are found, as you have done
below.

Second, Fox tables can be associated with a "Database Container" (DBC, DCT
memo, and DCX index files) which contains metadata about the tables and
other features such as stored procedures and triggers. If a DBC is present
the path in your connection string should be something like
"C:\ESS2001\DATA\Whatever.dbc" .

You can use the same types of ADO.NET code for Fox tables as you would for
any other OLE DB-compliant data source.


--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@xxxxxxx www.cindywinegarden.com


"EricLun" <eric_klyuen@xxxxxxxxxxx> wrote in message
news:127B59E8-4035-47DD-8C60-1BB7AFC249AD@xxxxxxxxxxxxxxxx

> How can i connect to a set of DBF files by
> What is the connection string to connect the DBF?
> I have try this one but error.
> connstr = "Provider = VFPOLEDB;Data Source=" & "C:\ESS2001\DATA\"
>
> I have the following question?
> 1. Does [OleDBConnection] Object support DBF Files? or i should use
> [ODBCConnection] ?
> 2. Should I it a must to have a "*.dbc" file ?
> 3. I need to use ADO instead of ADO.Net in VB.Net ?


.



Relevant Pages

  • Re: Cannot set CDX index on DBF file from C#
    ... > I am using .NET framework 2.0 to open Foxpro DBF files. ... > the connection / command process, none of the actual indexes ... > within the CDX file are being selected, so when I run a select SQL ... the FoxPro Index command requires exclusive use of the ...
    (microsoft.public.fox.helpwanted)
  • Re: changing fields length?
    ... Basically we don't OWN foxpro per se. ... application to use to make changes to my .dbf files. ... we'd have to also make changes at the reporting tool layer as well.. ... You can run any VFP command at runtime, If you want it I can send you a compiled app to acomplish this, in the case of modify an character field to 308 chars is not possible, just changing his data type to Memo. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Import DBF files with MEMO fields
    ... FoxPro and Visual FoxPro ODBC drivers work with all versions of FoxPro ... The DBF files are created by Foxpro 2.6 for Dos. ...
    (microsoft.public.access.externaldata)
  • Re: migrating foxpro to sql-server using c#
    ... do best with the FoxPro and Visual FoxPro OLE DB data provider, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: changing fields length?
    ... Basically we don't OWN foxpro per se. ... application to use to make changes to my .dbf files. ... we'd have to also make changes at the reporting tool layer as well.. ... field's character width at the database layer... ...
    (microsoft.public.fox.programmer.exchange)