note 8605 added to COM support functions for Windows

From: Date: Thu, 21 Sep 2000 00:43:53 +0000
Subject: note 8605 added to COM support functions for Windows
Groups: php.notes 
Request: Send a blank email to php-notes+get-5250@lists.php.net to get a copy of this message
<? # example use of ADODB and SQLOLEDB (MS-SQL 7) in PHP 4 # Tested on Win2K with PHP 4.02 $conn_obj = new COM("ADODB.Connection") or die("Cannot start ADO"); // replace myserver with your server name define ("OLEDB_CONNECTION_STRING", "Provider=SQLOLEDB; Data Source=myserver; Initial Catalog=Northwind; User ID=sa; Password="); // use SQL Server 7.0 OLE DB Provider $conn_obj->Open(OLEDB_CONNECTION_STRING); $command = "select lastname, firstname, title from employees"; // SQL Statement $rs = $conn_obj->Execute($command); // Recordset $i = 0; $fld0 = $rs->Fields(0); $fld1 = $rs->Fields(1); $fld2 = $rs->Fields(2); while (!$rs->EOF) { $i += 1; print "$fld0->value $fld1->value $fld2->value<BR>"; $rs->MoveNext(); } $rs->Close(); ?> http://www.php.net/manual/ref.com.php

« previous php.notes (#5250) next »