MDAC 2.5 SDK - Visual FoxPro ODBC Driver
Using the Visual FoxPro ODBC Driver with Your Visual Basic Application
Your Microsoft® Visual Basic® application can communicate with Visual FoxPro data by creating a data control that connects to a Visual FoxPro data source.
To connect to Visual FoxPro data using the Data Control in Visual Basic
- 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.