手順 1 : AdventureWorks2000 データベースに接続する

このトピックでは、LobSystem および LobSystemInstance オブジェクト用に XML を定義して、AdventureWorks2000 データベースに接続する方法について説明します。簡単に説明するために、このトピックで提供されるサンプルの XML は、パススルー認証を使用します。シングル サインオン (SSO) を使用する複雑なサンプルについては、「手順 7 (省略可能) : シングル サインオンを使用して AdventureWorks2000 データベースに接続する」を参照してください。

LobSystem オブジェクトは、特定のビジネス アプリケーションを記述するメタデータ用の最上位コンテナです。XML 表現では、その他すべてのメタデータ オブジェクトを含むルート ノードです。LobSystem オブジェクトの下にある LobSystemInstance オブジェクトは、ビジネス データ カタログに認証および接続文字列情報を提供します。

ビジネス データ カタログは、以下のデータベース認証モードをサポートします。

  • PassThrough

  • RevertToSelf

  • RdbCredentials

  • WindowsCredentials

詳細については、「ビジネス データ カタログの認証」を参照してください。

前提条件

メタデータを記述する前に、環境をセットアップする必要があります。この例では、Microsoft Office SharePoint Server 2007 を設定済みで、AdventureWorks2000 サンプル データベースをインストール済みであると仮定しています。

Microsoft SQL Server 2000 の既定のインストールでは、AdventureWorks2000 データベースが含まれません。Microsoft ダウンロード センターから AdventureWorks2000 サンプル データベースをダウンロードしてください。AdventureWorks2000 データベースは、Office SharePoint Server 2007 がインストールされたコンピュータにインストールする必要があります。

AdventureWorks2000 データベースに接続するには

  1. テキスト ファイルを作成し、AdventureWorks2000.XML として保存します。保存場所はどこでもかまいません。

  2. 編集のためにテキスト エディタでテキスト ファイルを開きます。

  3. 以下の XML を挿入します。

    <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
    <!-- This metadata XML defines three entities: Product, Customer, 
    and SalesOrder from the AdventureWorks 2000 Sample database.-->
    <LobSystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="https://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" Type="Database" 
    Version="1.0.0.0" Name="AdventureWorksSample" 
    xmlns="https://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">
      <Properties>
        <Property Name="WildcardCharacter" Type="System.String">%</Property>
      </Properties>
      <LobSystemInstances>
        <LobSystemInstance Name="AdventureWorksSampleInstance">
          <Properties>
            <Property Name="AuthenticationMode" 
    Type="System.String">PassThrough</Property>
            <!--AuthenticationMode can be set to PassThrough, 
            RevertToSelf, RdbCredentials, or WindowsCredentials. -->
            <Property Name="DatabaseAccessProvider" 
    Type="System.String">SqlServer</Property>
            <!-- Can be SqlServer, OleDb, Oracle, or Odbc for database 
            systems. -->
            <Property Name="RdbConnection Data Source" Type="System.String">EnterYourAdventureWorks2000ServerNameHere</Property>
            <!-- The name of your server hosting the AdventureWorks2000 
                 database or the name of the SQL Server instance in the 
                 format SQLServer\Instance. -->
            <Property Name="RdbConnection Initial Catalog" 
    Type="System.String">AdventureWorks2000</Property>
            <!-- The name of the database.> -->
            <Property Name="RdbConnection Integrated Security" 
    Type="System.String">SSPI</Property>
            <Property Name="RdbConnection Pooling" 
    Type="System.String">false</Property>
          </Properties>
        </LobSystemInstance>
      </LobSystemInstances>
      <Entities>
        <!-- Enter your Entity XML here -->
      </Entities>
    </LobSystem>
    
  4. LobSystemInstance メタデータでは、RdbConnection Data Source プロパティの AdventureWorks2000 データベースをホストする SQL Server の名前に合わせて置き換えます。SQL Server インスタンスを使用している場合は、SQLServer\Instance の形式を使用します。

  5. XML ファイルを保存します。

Next Steps

手順 2 : エンティティ、メソッド、およびフィルタの定義

See Also

タスク

AdventureWorks SQL Server 2000 のサンプル

概念

ビジネス データ カタログ : メタデータ モデル