0

I have this function from: https://github.com/IgnitedDatatables/Ignited-Datatables/

private function get_paging()
{
    $iStart = $this->ci->input->post('iDisplayStart');
    $iLength = $this->ci->input->post('iDisplayLength');

    if($iLength != '' && $iLength != '-1')
        $this->ci->db->limit($iLength, ($iStart)? $iStart : 0);
}

In MySQL this function works perfectly. However, in MS Access won't work because "limit" is not supported. So my question is how can I change

$this->ci->db->limit($iLength, ($iStart)? $iStart : 0); 

to a MS Access notation?

Raidri
  • 17,258
  • 9
  • 62
  • 65
Ramzendo
  • 576
  • 1
  • 5
  • 16

1 Answers1

1

Codeigniter did not support limit() on odbc driver.

This code copy from "system/database/drivers/odbc/odbc_driver.php" line 611

function _limit($sql, $limit, $offset)
{
    // Does ODBC doesn't use the LIMIT clause?
    return $sql;
}

As you see that it does not generate any TOP query command.

To use limit (TOP) in Access database. change to manual query and use

$this->ci->db->query('your query here');
vee
  • 4,506
  • 5
  • 44
  • 81