Visual Foxpro data bases (dbc)

Startbeitrag von javier garcia.pcs.crosspost am 28.07.2008 07:33

Hello everyone, I need to open a database (dbc) of visual foxpro.
If the table attached to the analysis as native access for WD, the file doesn't read well, only read 3 of the nearly 30000 records in the file. And if I do so through ODBC, then I can't use the table to create a query with the wizard.
I want to open the table, read all the records and that could create a query from it.
Someone may help me.
Thanks for your help.
I use WinDev XII with Windows Vista.

Message forwarded from


To access VFP DBCs use the OLE/DB provider. You can download it here:

Here is a sample of how to access a a VFP DBF via OLE/DB. I am accessing the DBFs directly but the principle is the same for accessing them via DBCs.

// Define some variables for access the DBF via OLE/DB
cn_VFPData is Connection
ds_VFPData is Data Source
l_sQueryString is string

// Fill in items in the Connection
cn_VFPData..User = ""
cn_VFPData..Password = ""
cn_VFPData..Server = "localhost"
cn_VFPData..Database = ""
cn_VFPData..Source = "I:\ProgDir\DataDir"
cn_VFPData..Provider = "VFPOLEDB.1"
cn_VFPData..Access = hOReadWrite
cn_VFPData..ExtendedInfo = ""

// Open the Connection
IF NOT HOpenConnection( cn_VFPData ) THEN

// Build the query in a String variable
// -----------------
// Note 1: The variable is enclosed in double quotes so we need to use either
// single quotes or [] brackets to enclose text within the query string
// -----------------
// Note 2: This is VFP SQL here, type it as if you were going to execute it from
// the VFP command window
sQueryString = "SELECT field1, field2, filed3, field4 FROM VFP_DBF WHERE TextField='ABCD' AND NumericField=1234 AND DTOS(DateField) = '20080728'"
IF NOT HExecuteSQLQuery(ds_VFPData, cn_VFPData, hQueryWithoutCorrection, sQueryString) THEN

// Set to True to view results via the WinDev BuildBrowsingTable function
BuildBrowsingTable(TABLE_VFPData, ds_VFPData, taFillTable)
{"TABLE_VFPData._COL4"}..InputMask = "MM/DD/YYYY"

// Set to True to step through results and add them to a WinDev Table
WHILE HOut(ds_VFPData) = False
TableAddLine(TABLE_VFPData, ds_VFPData.field1, ds_VFPData.field2, ds_VFPData.field3, ds_VFPData.field4)



For more information see the following topics in the VFP help file:

How to: Access Visual FoxPro Data in Visual Studio

Language Reference for OLE DB Development

von David Martin - am 28.07.2008 12:44
Zur Information: hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.