| title | Use the VFP FoxPro ODBC Driver with Your Visual Basic Application | Microsoft Docs | ||||
|---|---|---|---|---|---|
| ms.custom | |||||
| ms.date | 01/19/2017 | ||||
| ms.prod | sql | ||||
| ms.prod_service | connectivity | ||||
| ms.reviewer | |||||
| ms.technology | connectivity | ||||
| ms.topic | conceptual | ||||
| helpviewer_keywords |
|
||||
| ms.assetid | 5223ca23-5df6-4ebc-aa3b-70682ff27a8c | ||||
| author | David-Engel | ||||
| ms.author | v-daenge |
Your Microsoft® Visual Basic® application can communicate with Visual FoxPro data by creating a data control that connects to a Visual FoxPro data source.
-
Create a data source named "test" that connects to the TasTrade sample database included in Visual FoxPro. The default Visual FoxPro installation places the TasTrade sample database in the location:
c:\vfp\samples\mainsamp\data\tastrade.dbc -
In Visual Basic, create a new form and place a text box and a Data control on it.
-
Change the Data control's Connect property as follows:
ODBC;DATABASE=tastrade;DSN=test -
Change the RecordsetType property to the following:
2 - Snapshot -
Change the RecordSource property to the following:
customer -
Change the DataSource property for the text box to the default name for the Data control to the following:
data1 -
Change the text box's DataField property to the following:
customer_id -
Run the form, and use the Data control to skip through the customer id fields from the Visual FoxPro TasTrade sample database.