Hi, I do work at Easysoft (Hi Richard, how it going? :-)), and I have
been taking a look at cake and the SQL Server driver. I have found a
couple of things that may help you (though without seeing exactly what
the problem you are having is its based on what I have found).
1. There is a bug in the unixODBC cursor lib that causes problem.
There is a fix in the 2.2.15pre version now on ftp.unixodbc.org
2. It seems that the code on dbo_odbc.php assumes that all databases
use ` as the delimiter, this is clearly wrong, and will cause most
queries to fail. This can be fixed by changing the code in cake/libs/
model/datasources/dbo/dbo_odbc.php at or about line 49 change the
definition of start and end quotes to the SQL Standard of a double
quote
var $startQuote = "\"";
var $endQuote = "\"";
3. By default SQL Server only allows one active statement, php has
traditionally tried to work around this by using dynamic cursors for
the connection. This will work with our driver, but as the cake code
brings in the cursor lib, it defeats some of this. The use of the
cursor lib can be disabled byrt editing the same file again, and on
line 101 change the line
$this->connection = $connect($config['database'], $config['login'],
$config['password'], SQL_CUR_USE_ODBC);
to
$this->connection = $connect($config['database'], $config['login'],
$config['password'], SQL_CUR_USE_DRIVER);
4. I am unsure just why, but if 3 is not done, then you will get a
error about multiple active statements (I know whay you get the error,
I am just unsure whats going on with the reuse of the statements). But
as you are trying to use the Easysoft driver, if you are going to a
SQL Server 2005 or later database, you can make use of the multiple
active statement feature by enabling it in the odbc.ini entry. Adding
a
Mars_Connection = Yes
To the connection info.
Hopefully this will help, if not let me know, and the more detail you
can provide the better.
On Feb 16, 12:04 pm, RichardAtHome wrote:
> I'd start with a blank (non-cake) php page and try and get that
> working to make sure your odbc driver is set up correctly.
>
> Haven't used ODBC with cake but I can tell you the Easysoft stuff is
> very good (caveat: I used to work at Easysoft :-) )
>
> On Feb 12, 4:37 pm, Stinkbug wrote:
>
> > We're trying to connect to sql server and we've installed the EasySoft
> > MS SQL Driver and I'm told that the connection is working (I'm not the
> > one that installed it and test it), but we can't get it to work in
> > Cake.
>
> > Has anyone tried using this driver and if so, what did you have to do
> > to get it to work?
>
> > Our database config looks something like this.
>
> > var $webserver = array(
> > 'driver' => 'odbc',
> > 'connect' => 'webserver',
> > 'persistent' => false,
> > 'host' => 'webserver',
> > 'login' => 'saweb',
> > 'password' => '54web',
> > 'database' => 'webserver',
> > 'prefix' => '',
> > );
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---