> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mode

> このページではMode をConnect AI の仮想SQL Server API に接続する手順の概要を示します。

## 前提条件

接続する前にまず以下を実行します。

* データソースをConnect AI アカウントに接続します。詳しくは、[Sources](/ja/Sources) を参照してください。
* [Settings](/ja/Settings#personal-access-tokens) ページでPersonal Access Token (PAT) を生成します。PAT をコピーし、認証時にパスワードとして使用します。

## Connect AI に接続する

Mode からConnect AI の仮想SQL Server API へのコネクションを確立するには以下の手順に従います。

<Steps>
  <Step>
    Log in to Mode.
  </Step>

  <Step>
    On the **Discover** page of Mode, click **Connect a Database**.

    <Frame>
      <img src="https://mintcdn.com/cdata/YITfVTwoqsOOaiRq/ja/images/mode_client_connect_database.png?fit=max&auto=format&n=YITfVTwoqsOOaiRq&q=85&s=e792f0e2eeb9da3f12c6b90eda93bb3b" alt="Mode Client Connect Database" width="668" height="679" data-path="ja/images/mode_client_connect_database.png" />
    </Frame>
  </Step>

  <Step>
    On the next screen, select **Microsoft SQL Server**.

    <Frame>
      <img src="https://mintcdn.com/cdata/YITfVTwoqsOOaiRq/ja/images/mode_client_sql_server.png?fit=max&auto=format&n=YITfVTwoqsOOaiRq&q=85&s=6f3b0268f5265af318aa423b2664df1d" alt="Mode Client SQL Server" width="1003" height="866" data-path="ja/images/mode_client_sql_server.png" />
    </Frame>
  </Step>

  <Step>
    Enter the following Microsoft SQL Server settings.

    * **Display name**—enter the name of your connection for display purposes.
    * **Host**—*tds.cdata.com*
    * **Port**—*14333*
    * **Database name**—接続したいConnect AI データソースのConnection Name を入力します。例：*Salesforce1*
    * **Username**—Connect AI のユーザー名を入力します。ユーザー名は、Connect AI の画面の右上に表示されています。例：*[test@cdata.co.jp](mailto:test@cdata.co.jp)*
    * **Password**—[Settings](/ja/Settings#personal-access-tokens) ページで生成したPAT を入力します。
      Leave the rest of the connections settings at their default values unless you need to modify them.

    <Frame>
      <img src="https://mintcdn.com/cdata/YITfVTwoqsOOaiRq/ja/images/mode_client_connection_credentials.png?fit=max&auto=format&n=YITfVTwoqsOOaiRq&q=85&s=444a52f683ae1afc96dbaadc28d7e9c1" alt="Mode client connection credentials" width="616" height="1077" data-path="ja/images/mode_client_connection_credentials.png" />
    </Frame>
  </Step>

  <Step>
    Click **Connect**. If the connection succeeds, a success message appears. Your connection is now available for use in Mode.
  </Step>

  <Step>
    Repeat the steps above to connect to additional Connect AI sources, changing the **Database name** for each one.
  </Step>
</Steps>

You can now create a Mode visualization with the Connect AI data. Follow the steps below.

<Steps>
  <Step>
    After your connection succeeds, click **New Report**. The SQL query text editor appears.

    <Frame>
      <img src="https://mintcdn.com/cdata/YITfVTwoqsOOaiRq/ja/images/mode_client_create_report.png?fit=max&auto=format&n=YITfVTwoqsOOaiRq&q=85&s=3f8444a412510d2688ba7128dac19b11" alt="Mode Client Create Report" width="1615" height="448" data-path="ja/images/mode_client_create_report.png" />
    </Frame>
  </Step>

  <Step>
    Enter a SQL query for your data, such as:
  </Step>
</Steps>

```sql theme={null}
SELECT * FROM [Sharepoint].[MyCustomList];
```

<Steps>
  <Step>
    Click **Run** to run the query. The data appears below.
  </Step>

  <Step>
    Click **+New chart** to create visualizations from the data.

    <Frame>
      <img src="https://mintcdn.com/cdata/YITfVTwoqsOOaiRq/ja/images/mode_client_create_chart.png?fit=max&auto=format&n=YITfVTwoqsOOaiRq&q=85&s=0d6a97db66445d8a787ba648bfeaedbb" alt="Mode Client Create Chart" width="1593" height="994" data-path="ja/images/mode_client_create_chart.png" />
    </Frame>
  </Step>
</Steps>
