mxarievilo
12-07-2009, 09:23 AM
But I'm not access developer and using PHP.
Isn't running becouse the original developer set data table field as a text.
<?php
//Eu preciso fazer uma consulta onde me mostre apenas os registros que irão vencer nos proximos 15 dias
// (I want to list upcoming events stored in database for the next 15 days)
$conexao = new COM("ADODB.Connection");
$conexao->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\wd\\negociofeito\\admin\\dat\\bd.mdb"); //conexão maquina local
$recordset = $conexao->Execute("select * from PRO where PRO_DTCAD > (NOW() - PRO_DURAC) AND PRO_DTCAD < (NOW()+15)"); //running, but not filtering
//$recordset = $conexao->Execute("select * from PRO"); // só a listagem rodando normal (OK)
echo "CÓDIGO" . " | " . "NOME" . " | " . "PREÇO" . " | " . "DATA CADASTRO" . " | " . "DURAÇÃO ANÚNCIO" . "<BR/>";
while (!$recordset->EOF) {
echo " | " . $recordset->fields["PRO_COD"]->value;
echo " | " . $recordset->fields["PRO_NOME"]->value;
echo " | " . $recordset->fields["PRO_PRECO"]->value;
echo " | " . $recordset->fields["PRO_DTCAD"]->value; //register data
echo " | " . $recordset->fields["PRO_DURAC"]->value; //duration
echo "<br/>";
$recordset->MoveNext();
}
$conexao->Close();
?>
Isn't running becouse the original developer set data table field as a text.
<?php
//Eu preciso fazer uma consulta onde me mostre apenas os registros que irão vencer nos proximos 15 dias
// (I want to list upcoming events stored in database for the next 15 days)
$conexao = new COM("ADODB.Connection");
$conexao->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\wd\\negociofeito\\admin\\dat\\bd.mdb"); //conexão maquina local
$recordset = $conexao->Execute("select * from PRO where PRO_DTCAD > (NOW() - PRO_DURAC) AND PRO_DTCAD < (NOW()+15)"); //running, but not filtering
//$recordset = $conexao->Execute("select * from PRO"); // só a listagem rodando normal (OK)
echo "CÓDIGO" . " | " . "NOME" . " | " . "PREÇO" . " | " . "DATA CADASTRO" . " | " . "DURAÇÃO ANÚNCIO" . "<BR/>";
while (!$recordset->EOF) {
echo " | " . $recordset->fields["PRO_COD"]->value;
echo " | " . $recordset->fields["PRO_NOME"]->value;
echo " | " . $recordset->fields["PRO_PRECO"]->value;
echo " | " . $recordset->fields["PRO_DTCAD"]->value; //register data
echo " | " . $recordset->fields["PRO_DURAC"]->value; //duration
echo "<br/>";
$recordset->MoveNext();
}
$conexao->Close();
?>