Welcome Guest, Not a member yet? Register   Sign In
Scaffolding and MS Access using ODBC broken?
#1

[eluser]falloutphil[/eluser]
Hi,

I'm newbie to CI - love what I've seen so far but I've hit a snag running through the tutorials. The only thing I'm doing different is using an MS Access 2000 db (not my choice - it's the way it has to be).

I'm at the point in the 20min blog tutorial where we set up scaffolding. All is well when I load up the initial Scaffolding page - it reports back that my table contains no entries correctly. However if I try to use the 'add' functionality I just get a blank page. The following error pops up in Apache:

[Sat Dec 29 02:47:28 2007] [error] [client 127.0.0.1] PHP Fatal error: Call to a member function field_data() on a non-object in C:\\Web\\system\\database\\DB_driver.php on line 797

function field_data($table = '')
{
if ($table == '')
{
if ($this->db_debug)
{
return $this->display_error('db_field_param_missing');
}
return FALSE;
}

$query = $this->query($this->_field_data($this->dbprefix.$table));
return $query->field_data(); <---- PROBLEM LINE
}
Looks like we have a null reference being returned?

I'm using Apache 2.0.61/PHP 5.2.5/CI 1.5.4.

I've exhausted every avenue I can think of - it's probably something painfully obvious - even if it is - it would be great if someone could give me a hand.

Cheers,

Phil.

DB:

id: AutoNumber (Set as Primary)
title: Text (length=128)
body: Memo (I've tried Text here too).

Broken URL:
http://localhost:8080/index.php/blog/scaffolding/add

Database.php:

$db['default']['hostname'] = "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\Web\CodeIgniterDB.mdb;Uid=Admin;Pwd=";
$db['default']['username'] = "Admin";
$db['default']['password'] = "";
$db['default']['database'] = "CodeIgniterDB.mdb";
$db['default']['dbdriver'] = "odbc";
$db['default']['dbprefix'] = "";
$db['default']['active_r'] = TRUE;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";

Blog.php:

&lt;?php
class Blog extends Controller {

function Blog()
{
parent::Controller();
$this->load->scaffolding('entries');
}


function index()
{
$data['todo_list'] = array('Clean House', 'Call Mom', 'Run Errands');

$data['title'] = "My Real Title";
$data['heading'] = "My Real Heading";

$this->load->view('blogview', $data);
}
}
?&gt;
#2

[eluser]falloutphil[/eluser]
Just a bit more info - it appears that if I add a table entry in MS Access, this results in scaffolding failing completely (blank page).

It looks as if Scaffolding is only happy with an empty database?

Phil.




Theme © iAndrew 2016 - Forum software by © MyBB