Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > by-pkgid > 703d980c580707c382b4e43e25965bc5 > files > 12055

php-manual-pt_BR-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>PDO_ODBC DSN</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Manual do PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="ODBC and DB2 Functions (PDO_ODBC)"
HREF="ref.pdo-odbc.html"><LINK
REL="PREVIOUS"
TITLE="ODBC and DB2 Functions (PDO_ODBC)"
HREF="ref.pdo-odbc.html"><LINK
REL="NEXT"
TITLE="oggvorbis"
HREF="ref.oggvorbis.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual do PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="ref.pdo-odbc.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="ref.oggvorbis.html"
ACCESSKEY="N"
>Próxima</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="ref.pdo-odbc.connection"
></A
>PDO_ODBC DSN</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN157616"
></A
><P
>    (no version information, might be only in CVS)</P
>PDO_ODBC DSN&nbsp;--&nbsp;Connecting to ODBC or DB2 databases</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN157619"
></A
><H2
>Descrição</H2
><P
>&#13;     The PDO_ODBC Data Source Name (DSN) is composed of the following elements:
     <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
>DSN prefix</DT
><DD
><P
>&#13;        The DSN prefix is <KBD
CLASS="userinput"
>odbc:</KBD
>. If you are connecting
        to a database cataloged in the ODBC driver manager or the DB2 catalog,
        you can append the cataloged name of the database to the DSN.
        </P
></DD
><DT
><TT
CLASS="constant"
><B
>DSN</B
></TT
></DT
><DD
><P
>&#13;         The name of the database as cataloged in the ODBC driver manager or
         the DB2 catalog. Alternately, you can provide a complete ODBC
         connection string to connect to a database as described at
         <A
HREF="http://www.connectionstrings.com/"
TARGET="_top"
>http://www.connectionstrings.com/</A
>.
        </P
></DD
><DT
><TT
CLASS="constant"
><B
>UID</B
></TT
></DT
><DD
><P
>&#13;         The name of the user for the connection. If you specify the user name
         in the DSN, PDO ignores the value of the user name argument in the
         PDO constructor.
        </P
></DD
><DT
><TT
CLASS="constant"
><B
>PWD</B
></TT
></DT
><DD
><P
>&#13;         The password of the user for the connection. If you specify the
         password in the DSN, PDO ignores the value of the password argument
         in the PDO constructor.
        </P
></DD
></DL
></DIV
>
    </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN157644"
></A
><H2
>Exemplos</H2
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN157647"
></A
><P
><B
>Exemplo 1. PDO_ODBC DSN example (ODBC driver manager)</B
></P
><P
>&#13;       The following example shows a PDO_ODBC DSN for connecting to
       an ODBC database cataloged as testdb in the ODBC driver manager:
       <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="programlisting"
>odbc:testdb</PRE
></TD
></TR
></TABLE
>
      </P
></DIV
></TD
></TR
></TABLE
>
     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN157651"
></A
><P
><B
>Exemplo 2. PDO_ODBC DSN example (IBM DB2 uncataloged connection)</B
></P
><P
>&#13;       The following example shows a PDO_ODBC DSN for connecting to
       an IBM DB2 database named <KBD
CLASS="userinput"
>SAMPLE</KBD
> using the full
       ODBC DSN syntax:
       <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="programlisting"
>odbc:DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME=localhost;PORT=50000;DATABASE=SAMPLE;PROTOCOL=TCPIP;UID=db2inst1;PWD=ibmdb2;</PRE
></TD
></TR
></TABLE
>
      </P
></DIV
></TD
></TR
></TABLE
>
     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN157656"
></A
><P
><B
>Exemplo 3. PDO_ODBC DSN example (Microsoft Access uncataloged connection)</B
></P
><P
>&#13;       The following example shows a PDO_ODBC DSN for connecting to
       a Microsoft Access database stored at <KBD
CLASS="userinput"
>C:\db.mdb</KBD
> using the full
       ODBC DSN syntax:
       <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="programlisting"
>odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\db.mdb;Uid=Admin</PRE
></TD
></TR
></TABLE
>
      </P
></DIV
></TD
></TR
></TABLE
>
     
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="ref.pdo-odbc.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Principal</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="ref.oggvorbis.html"
ACCESSKEY="N"
>Próxima</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>ODBC and DB2 Functions (PDO_ODBC)</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.pdo-odbc.html"
ACCESSKEY="U"
>Acima</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>oggvorbis</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>