Warning: file_put_contents(): Only -1 of 54 bytes written, possibly out of free disk space in /var/www/html/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 25
odbc_commit odbc_cursor ODBC PHP Manual odbc_connect (PHP 4, 5) — データソースに接続する 説明 resource ( string $dsn , $user $password [, int $cursor_type ] ) 接続 ID 、または...
Forum und email

odbc_connect

(PHP 4, PHP 5)

odbc_connect — データソースに接続する

説明

resource odbc_connect ( string $dsn , string $user , string $password [, int $cursor_type ] )

ODBC 接続 ID 、またはエラーの場合に 0 (FALSE) を返します。

この関数により返される接続 ID は、他の ODBC 関数により使用されます。 異なる db や異なる権限を使用する限り、 複数の接続を同時にオープンすることができます。オプションの 4 番目のパラメータは、 この接続で使用されるカーソルの型を設定します。 通常はこのパラメータは必要ありませんが、いくつかの ODBC ドライバの問題に対処する際には有用です。

いくつかの ODBC ドライバでは、複雑なストアド・プロシージャの 実行時に次のようなエラーにより失敗する可能性があります。 "Cannot open a cursor on a stored procedure that has anything other than a single select statement in it" SQL_CUR_USE_ODBC を使用することにより、 このようなエラーを回避できる可能性があります。 また、いくつかのドライバは odbc_fetch_row() においてオプションの row_number パラメータをサポートしません。 この場合でも、SQL_CUR_USE_ODBC により解決できる可能性があります。

次のような定数がカーソル型として定義されています。

  • SQL_CUR_USE_IF_NEEDED
  • SQL_CUR_USE_ODBC
  • SQL_CUR_USE_DRIVER
  • SQL_CUR_DEFAULT

持続的な接続を行うには、odbc_pconnect() を参照ください。