Use the OleDbQuery when connecting to an OLE database provider (such as Access).
The Query component returns a dataset or executes a command (such as insert or update). If the Query returns data, the dataset is created as part of the Query component. You can display the returned data by either connecting the Query GetTable method or by specifying the Query as the provider for a TableView and then binding the TableView to a visible component (such as a DataGrid or ListBox) by using the DataSource property of the control.
The Connection String property provides access to the Microsoft Data Link Properties window. Use this series of dialogs to identify the data source and create a connection string.
When you add this component to an automation, the system places it on the Global tab of the component tray. For more information, see Adding Global Components to an Automation. This component must be global to be referenced by other automations in the project.
The SQL statement.
Use the question mark (?) for parameters in the OleDbQuery. For example: OleDbQuery: Select CustomerID, CompanyName, ContactName, Country, Region FROM Customers WHERE Country = ?
|CommandTimeout||The amount of time you want the solution to wait to execute the query. The default is 30 seconds.|
|CommandType||Specifies how the CommandText is interpreted. |
|ConnectionString||The string used to open the data source. To create the Connection String, browse this property to open the Microsoft Data Link Properties window. Click the Help button on this dialog for more information.|
Browse this property to open the OleDbParameter Collection Editor dialog and set default values for parameters used in the CommandText. An example of this dialog is shown below.
Note that you must test the query for the query parameters to be fully defined in the project. If you run the project without testing the query in Studio, an error is thrown. Click the Test Query link to test the query with the parameters.
|Execute||Runs the SQL statement against the designated datasource.||As specified by the SQL statement||Void|
|GetTable||Use this method to return a data table containing the query data.||None||DataTable|