CData FireDAC Components for Business b-ridge を使用し、RAD Studio でBusiness b-ridge を表示するシンプルなVCL Application を構築する方法
Embarcadero RAD Studio は、Delphi およびC++Builder アプリケーション用の開発環境を提供します。CData FireDAC Components for Business b-ridge を利用してRAD Studio 内のライブBusiness b-ridge にアクセスし、データの取得の両方に使用できるテーブル、ビュー、ストアドプロシージャにデータを抽象化します。この記事では、Business b-ridge への接続と、フォームデザイナを使用した簡単なVCL アプリケーションの作成について説明します。
VCL Application for Business b-ridge データを作成する
以下の手順では、、シンプルなVCL フォームアプリケーションを作成する方法を示しています。これにより、フォームデザイナを使用し、任意のアプリケーションからBusiness b-ridge に接続するために必要である基本的なFireDAC オブジェクトを示すことができます。
次の例では、TDBGrid コントロールを設定します。
- 新しいVCL フォームアプリケーションを作成します。
- TFDPhysBusinessBridgeDriverLink およびTFDConnection オブジェクトをフォームにドロップします。
TFDConnection オブジェクトをダブルクリックします。[FireDAC Connection Editor]が表示されます。[DriverId]メニューの[CData.BusinessBridge]を選択し、接続プロパティを構成します。
When connecting to Business b-ridge, CompanyKey, ProjectKey, and SubscriptionKey are required.
To obtain the SubscriptionKey, follow the steps below:
- Log in to Business b-ridge API Protal and go to "Profile" in the "Your name" menu.
- In your subscription section click "Main Key" to retrieve their respective values.
Authenticate to Business b-ridge Account
Set the following connection properties to connect:
- CompanyKey: Set the Business b-ridge Company Key of the connection destination.
- ProjectKey: Set the Business b-ridge Project Key of the connection destination.
- SubscriptionKey: Set the value "Subscription Key".
- TFDQuery オブジェクトをフォームにドロップし、以下のプロパティを設定します。
- 接続 - オブジェクトが未指定の場合、このプロパティをTFDConnection オブジェクトに設定します。
- SQL - SQL プロパティのボタンをクリックし、クエリを入力します。
- アクティブ - このプロパティをtrue に設定します。
- TDataSource オブジェクトをフォームにドロップし、以下のプロパティを設定します。
- データセット - このプロパティのメニューで、TFDQuery オブジェクトの名前を選択します。
- TDBGrid オブジェクトをフォームにドロップし、以下のプロパティを設定します。
- データソース - TDataSource の名前を選択します。
TFDGUIxWaitCursor をフォームにドロップします。これは、実行時のエラーを回避するために必要です。
これで、TFDQuery オブジェクトに設定されたSQL クエリの結果を表示する、実行可能なアプリケーションが構築されます。
