$myPass = "******"; $myDB = "IABAS2014_ACS_set"; //create an instance of the ADO connection object $conn = new COM ("ADODB.Connection") or die("Cannot start ADO"); //define connection string, specify database driver $connStr = "PROVIDER=SQLOLEDB;SERVER=".$myServer.";UID=".$myUser.";PWD=".$myPass.";DATABASE=".$myDB; $conn->open($connStr); //Open the connection to the database //declare the SQL statement that will query the database $query = "SELECT * FROM CANDIDATOS"; //execute the SQL statement and return records $rs = $conn->execute($query); $num_columns = $rs->Fields->Count(); echo $num_columns . "<br>"; for ($i=0; $i < $num_columns; $i++) { $fld[$i] = $rs->Fields($i); } echo "<table>"; while (!$rs->EOF) //carry on looping through while there are records { echo "<tr>"; for ($i=0; $i < $num_columns; $i++) { echo "<td>" . $fld[$i]->value . "</td>";
/** * Get Invitation List from database **/ function getInvitationList() { // Require DB Config require_once "../lib/picasa/config.php"; // Records Array $allRec = array(); // Create an instance of ADO connection object $conn = new COM("ADODB.Connection") or die("Cannot start ADO"); // Define connection string, specify database driver $connStr = "PROVIDER=SQLOLEDB;SERVER=" . $server . ";UID=" . $username . ";PWD=" . $passwd . ";DATABASE=" . $db; $conn->open($connStr); //Open the connection to the database //SQL statement that will query the database $query = "SELECT * FROM tbl_picasa"; //execute SQL statement and return records $rs = $conn->execute($query); $num_columns = $rs->Fields->Count(); for ($i = 0; $i < $num_columns; $i++) { $fld[$i] = $rs->Fields($i); } while (!$rs->EOF) { $rec = array(); for ($i = 0; $i < $num_columns; $i++) { array_push($rec, $fld[$i]->value); } array_push($allRec, $rec); $rs->MoveNext(); //move on to the next record } //close the connection and recordset objects freeing up resources $rs->Close(); $conn->Close(); $rs = null; $conn = null; return $allRec; }
} } ////////////////////////////../PHP/certificado.php //create an instance of the ADO connection object $conn = new COM("ADODB.Connection") or die("Cannot start ADO"); //define connection string, specify database driver //$connStr = "Microsoft.ACE.OLEDB.12.0;Data Source=D:\inetpub\wwwroot\Dropbox\BDs\Arrendamientos.mdb"; //Siteserver//$connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Domains\ventayrenta.info\database\Arrendamientos.mdb"; $connStr = "provider= Microsoft.ACE.OLEDB.12.0;Data Source=D:\\inetpub\\wwwroot\\Dropbox\\BDs\\Arrendamientos.mdb"; $conn->open($connStr); //Open the connection to the database //declare the SQL statement that will query the database $query = "SELECT r.*, a.CalleYNumeroDelDomicilio, a.Colonia, a.CodigoPostal, a.DelegacionOMunicipio, a.Ciudad, a.Estado, a.GiroDelInmuebleArrendado, a.PropietarioCve, a.estado FROM registro_proteccion r, arrendamientos a WHERE r.arrcve=a.arrcve AND r.REGCVE='" . $_REQUEST['arrcve'] . "' AND r.NoAutorizacion=" . $_REQUEST['NoAutorizacion']; //echo($query."<p>"); //execute the SQL statement and return records $rs = $conn->execute($query); if (!$rs->EOF) { //echo $query; $num_columns = $rs->Fields->Count(); //echo($num_columns); for ($i = 0; $i < $num_columns; $i++) { $fld[$i] = $rs->Fields($i); } $Gtomadeposecion = "15,000.00"; $diasN = "20"; $calle = ucwords(strtolower($fld[48]->value)); $Colonia = ucwords(strtolower($fld[49]->value)); $Del_Mun = ucwords(strtolower($fld[51]->value)); $Estado = ucwords(strtolower(NEstados($fld[53]->value))); $CP = $fld[50]->value; $GiroInm = $fld[54]->value;