Re: PEAR DB/DataObjects and MSSQL
| From: | Barry Steele | Date: | Tue, 09 Mar 2004 06:00:03 +0000 |
| Subject: | Re: PEAR DB/DataObjects and MSSQL | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11173@lists.php.net to get a copy of this message | ||
Hi Frank,
Thanks for that. I'm in the process of installing FreeTDS now. I'll
let you know how we get on.
Thanks again,
Barry
On Tue, 2004-03-09 at 16:22, Frank M. Kromann wrote:
> Hi Barry,
>
> DB::MSSQL use the mssql extension for PHP. That means you have to compile
> php using --with-mssql=/path/to/freetds (or you can use the ODBTP that
> emulates the mssql extension).
>
> freetds must be configured to match your SQL server (TDS version 5, 7 or
> 8). If you use an IP address to connect to the server freetds will use the
> default configuration and that might not match your installation. You
> should always create an entry in freetds.conf and use the alias when
> connecting.
>
> It is always a good idea to the freetds and plain php (native mssql
> functions) before you try to use any form of abstraction layer (PEAR::DB,
> PEAR::MDB or your own).
>
> - Frank
>
> > Hi folks,
> > I'm in the process of setting up an application that will use a
> > Linux/Apache (RH9.0, Apache 2.0) web-server that accesses data from a
> > Windows SBS 2003 server running MSSQLSERVER.
> >
> > I built a small test harness to check the connection :
> >
> > <code>
> > <?
> > require_once ("DB.php");
> > require_once('PEAR.php');
> > require_once("Var_Dump.php");
> > //$DSN = "mssql://hpfm:hpfm@192.168.6.200/master";
> > $DSN = "mssql://hpfm:hpfm@SLSA1/Membership";
> > $options = array('debug' => 3);
> >
> > $db =& DB::connect($DSN,$options);
> > if (DB::isError($db))
> > {
> > /*
> > * This is not what you would really want to do in
> > * your program. It merely demonstrates what kinds
> > * of data you can get back from error objects.
> > */
> > echo 'Failed Standard Message: ' . $db->getMessage() . "\n";
> > Var_Dump::display($db);
> > }
> > else
> > {
> > echo "Yahoo!!! <b>we're connected! </b><br>";
> > $db->disconnect();
> > }
> >
> > // ...
> >
> >
> > ?>
> >
> >
> > </code>
> >
> > I get the following error message
> > Failed Standard Message: DB Error: no such database
> >
> >
> > To date I have done nothing in terms of configuring PHP or loading
> > utilities such as ODBTP.
> >
> > Has anyone out there had much experience in this area that might help?
> >
> > Thanks
> > Barry
> >
> > --
> > PEAR General Mailing List (http://pear.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
Barry Steele
hpfm solutions pty ltd
mob: 0413947980
fax: 0299817727
mailto:: barry@hpfm.com.au