Hi,

I'm having a problem connecting to a DB using ODBC in cake1.3, similar
to what has been posted here by another user:
http://groups.google.com/group/cake-php/browse_thread/thread/80748c2737f6f4b1/efbaf88dfe28b3da?hl=en#efbaf88dfe28b3da

When I browse to a page inside my cake that is supposed to retrieve
data from the database (which uses SQL Server btw), I too get the
error
        Fatal Error (256): ConnectionManager::loadDataSource - Unable to
import DataSource class .DboOdbc [CORE\cake\libs\model
\connection_manager.php, line 185]

I followed the readme.md instructions in https://github.com/cakephp/datasources:
downloaded the repository, extracted the folders 'models' and 'tests'
to cake_1_3\app\plugins\datasources and in my cake_1_3\app\config
\database.php I changed the previous configuration and added

        var $default = array(
                'datasource' => 'Datasources.XmlrpcSource',
                'driver' => 'odbc',
                'persistent' => false,
                'host' => '...',
                ...
        );

        var $test = array(
                'datasource' => 'Datasources.XmlrpcSource',
                'driver' => 'odbc',
                'persistent' => false,
                ...
        );

Now if I reload the page where I'm supposed to see data retrieved from
the database, my browser says

        Fatal error: Access level to XmlrpcSource::$_baseConfig must be
public (as in class DataSource) in F:\AppServ\www\cake_1_3\app\plugins
\datasources\models\datasources\xmlrpc_source.php on line 296

Browsing xmlrpc_source.php I find that $_baseConfig is set to
protected so I changed it to public, but now I get the error

        Fatal Error (256): ConnectionManager::loadDataSource - Unable to
import DataSource class .XmlrpcOdbc [CORE\cake\libs\model
\connection_manager.php, line 185]

After that I decided to try to use the datasource through App::import,
so I commented the 2 'datasource' => 'Datasources.XmlrpcSource' lines
in database.php and added the line

        App::import('Datasource', 'Datasources.XmlrpcSource');

to the file of the model that is supposed to retrieve data form the
database. However, I get this error again

        Fatal Error (256): ConnectionManager::loadDataSource - Unable to
import DataSource class .DboOdbc [CORE\cake\libs\model
\connection_manager.php, line 185]

Although the instructions don't specify, I'm assuming I must add the
'App::import' line to the model file. If I add it to the controller
file, for example, I get

        Fatal error: Class 'Datasource' not found in F:\AppServ\www
\cake_1_3\app\plugins\datasources\models\datasources\xmlrpc_source.php
on line 29

Line 29 is where you have 'class XmlrpcSource extends Datasource {'

I don't know if anyone can help me but thanks in advance and let me
know if I should supply more detailed information.

Ricardo

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to