MDAC 2.5 SDK - OLE DB Samples
Rowset Viewer Example
This example describes how to connect to a provider, execute a command, and use IOpenRowset.
To connect to a provider
- Start RowsetViewer.exe.
- From the File menu, choose Full Connect.
- Select MSDASQL as the provider and select your ODBC data source for the DataSource parameter. Use the ODBC Data Source Administrator to configure your data source. (OLE_DB_NWind_Jet is no longer available from this installation as a sample database.)
- Click OK.
To execute a command
- In the top pane of the MDI child window, type a query—for example:
SELECT * FROM CUSTOMERS
- Click the SQL button on the toolbar to run ICommand::Execute, or open the Command menu, select ICommand, and then click Execute. The ICommandExecute::Execute dialog box appears.
- Click OK.
To use IOpenRowset
- In the top pane of the MDI child window, type the name of a table in your data source—for example, CUSTOMERS.
- Make sure you are connected to a provider and click the ! button, or open the Session menu, select IOpenRowset, and then click IOpenRowset::Open Rowset.