Yes, a ODBC connection from Delphi is very similar to connecting using the BDE from Delphi. Here is an example of connecting using the Tquery component. This example will also display the results of a sql statement.
Drop a Tquery, a Tdatasource, and a Tdbgrid component on a Delphi form.
Set the following properties for the Tquery component: 1) DatabaseName: Pick "QuickBooks Data" from the list the data source names. 2) SQL: Input the sql statement to be executed. For example: "select * from Item". 3) Active: Set to True to connect. And supply no user name and password on connection.
Set the following properties for the Tdatasource component: 1) Data Set: Set to the name of the Tquery component, or "query1" in this case.
Set the following properties for the TDBGrid component: 1) Data Source: Set to the name of the Tdatasource component, or "data source1" in this case.
Now you can see the returned results from the select statement in the dbgrid area.
See: I am using Delphi and am getting some column not found errors on long field names. Why? See Also: Ado Item Query returns EOF in Delphi when wrong Cursor type is used |