cvs: phpdoc /en/reference/uodbc/functions odbc-connect.xml

From: Date: Tue, 23 Jun 2009 07:29:24 +0000
Subject: cvs: phpdoc /en/reference/uodbc/functions odbc-connect.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4205@lists.php.net to get a copy of this message
rquadling Tue Jun 23 07:29:24 2009 UTC Modified files: /phpdoc/en/reference/uodbc/functions odbc-connect.xml Log: DNS-less connection examples http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/uodbc/functions/odbc-connect.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/uodbc/functions/odbc-connect.xml diff -u phpdoc/en/reference/uodbc/functions/odbc-connect.xml:1.7 phpdoc/en/reference/uodbc/functions/odbc-connect.xml:1.8 --- phpdoc/en/reference/uodbc/functions/odbc-connect.xml:1.7 Tue May 20 15:36:08 2008 +++ phpdoc/en/reference/uodbc/functions/odbc-connect.xml Tue Jun 23 07:29:24 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry xml:id="function.odbc-connect" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>odbc_connect</refname> @@ -39,7 +39,8 @@ <term><parameter>dsn</parameter></term> <listitem> <para> - The database source name for the connection. + The database source name for the connection. Alternatively, a + DNS-less connection string can be used. </para> </listitem> </varlistentry> @@ -108,6 +109,31 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>DNS-less connections</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Microsoft SQL Server using the SQL Native Client 10.0 ODBC Driver - allows connection to SQL 7, 2000, 2005 and 2008 +$connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user, $password); + +// Microsoft Access +$connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename", $user, $password); + +// Microsoft Excel +$excelFile = realpath('C:/ExcelData.xls'); +$excelFir = dirname($excelFile); +$connection = odbc_connect("Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=$excelFile;DefaultDir=$excelDir" , '', ''); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para>

« previous php.doc.cvs (#4205) next »