このエレメントには Segment 子エレメントを格納することができます。 少なくとも 1 つ以上の Segment エレメントが含まれる場合は、接続文字列はそのエレメントと連結されます。 その他の場合、接続文字列は ConnectionString エレメント テキスト(現在のバージョンに含まれる)から取得されます。
このエレメントには、text および file の 2 つの有効な値を持つ Type と呼ばれる必須属性が格納されます。 Type="file" の場合、Segment エレメントには少なくとも 1 つの File エレメントを格納する必要があります。 File エレメントはそれぞれ別のクエリと考えます。
このエレメントには、接続文字列で使用する必要があるファイルおよびアダプタによる読み取り完了後のファイル処理を定義する属性が格納されます。
注: アダプタによる schema.ini ファイルの変更を許可する場合のみこの属性を使用します。
追加用の 2 つの内部変数が追加されており、SelectStatement エレメントおよび SelectInitialValues エレメントに使用できます。 内部変数については以下のとおりです。
例 1: Oracle 用の簡単な接続文字列
<ConnectionString> Provider=msdasql;dsn=O; uid=O; pwd=O </ConnectionString>
または
<ConnectionString> <Segement Type="text" Text="Provider=msdasql;"/> <Segement Type="text" Text="dsn=O; "/> <Segement Type="text" Text="uid=O; "/> <Segement Type="text" Text="pwd=O; "/> </ConnectionString>
例 2: Excel 用の簡単な接続文字列(単一ファイル)
<ConnectionString>Driver={Microsoft Excel Driver (*.xls)}; DriverId=790;
Dbq=d:\Oblicore\Availabilty_2003_01.XLS
</ConnectionString>
または
<ConnectionString>
<Segement Type="text" Text=" Driver={Microsoft Excel Driver (*.xls)};"/>
<Segement Type="text" Text=" DriverId=790;"/>
<Segement Type="text" Text=" Dbq="/>
<Segement Type="File">
<File Path="d:\Oblicore " NamePattern="Availabilty_2003_01.XLS">
</Segement>
</ConnectionString>
例 3: Excel 用の簡単な接続文字列(複数ファイル)
<ConnectionString>
<Segement Type="text" Text=" Driver={Microsoft Excel Driver (*.xls)};"/>
<Segement Type="text" Text=" DriverId=790;"/>
<Segement Type="text" Text=" Dbq="/>
<Segement Type="File">
<File Path="d:\Oblicore ",NamePattern="Availabilty_*.XLS"/>
</Segement>
</ConnectionString>
例 4: ODBC 標準の DSN エントリの使用
ODBC 標準の DSN エントリを使用すると、アプリケーション サーバの ODBC マネージャで作成された DSN エントリを持つすべてのソースに接続することができます。 ODBC 標準の DSN エントリは、サーバの「管理ツール」セクションにあります。
<ConnectionString>dsn=SampleDataSource;usr=scott;pwd=tiger;</ConnectionString>
| Copyright © 2012 CA. All rights reserved. | このトピックについて CA Technologies に電子メールを送信する |