Conecting to an MS access db (.mdb) usind odbc

View: New views
1 Messages — Rating Filter:   Alert me  

Conecting to an MS access db (.mdb) usind odbc

by David Santos Domínguez :: Rate this Message:

| View Threaded | Show Only this Message

Hi everybody:

Using Mysql everything worked perfect, now I'm trying to connect to an MS  
Access database usin odbc functions.
Here's my code:

///////////////////////

<?php
class obra
{ function obra()
{
$this->methodTable = array(
"getObra" => array(
"description" => "Devuelve registros en páginas",
"access" => "remote",
"pagesize" => "2",
)
);
}
function getObra( $offset = 0, $limit = 2)
{
$conn=odbc_connect('xxxxx', '', '');
$this->countQuery = sprintf("SELECT COUNT(*) AS
recordCount FROM obras");
return odbc_exec($conn,sprintf("SELECT * FROM obras LIMIT
%d, %d",$offset, $limit));
}

function getObra_count()
{
$q = odbc_exec($conn,$this->countQuery);
if($row = odbc_fetch_row($q)){
return $row['recordCount'];
}
else return 'No hay registros';
}
}

?>

///////////////////////


My problem is that the returned data is empty, i can only see the header  
of the columns of the table.
I think the odbcAdapter is not working automatically (should?), becase if  
erase or modify the odbcAdapter.php I get the same result.

Should I put something in the gateway.php to creape the mapping? or in  
another place? Anybody had ever tried to connect to an MS access database  
using amfphp successfully?

Ideas? Help? Please.

David

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
amfphp-general mailing list
amfphp-general@...
https://lists.sourceforge.net/lists/listinfo/amfphp-general