For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > September 2005 > Re: [PEAR] DB Newbie question.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] DB Newbie question.
Massimiliano Arione

2005-09-23, 3:58 am

LinuXKiD wrote:
> Standard Message: DB Error: connect failed Standard Code: -24 DBMS/User
> Message: [nativecode=IM002 [Microsoft][ODBC Driver Manager] Data source name
> not found and no default driver specified] ** Array DBMS/Debug Message:
> [nativecode=IM002 [Microsoft][ODBC Driver Manager] Data source name not
> found and no default driver specified] ** Array
> $dsn=array(


The error answers to your question.
Your DSN is wrong: it must be a string, not an array.
Maybe a deeper look at manual will be good for you.


--
Massimiliano Arione
:: http://garak.it ::
* No Word * http://gnu.org/philosophy/no-word-attachments.html
* No HTML * http://efn.no/html-bad.html
Rob Agar

2005-09-23, 3:58 am

Massimiliano Arione
> The error answers to your question.
> Your DSN is wrong: it must be a string, not an array.
> Maybe a deeper look at manual will be good for you.


actually it *can* be an array - maybe you need to read the code!

I would take a look at the DB_odbc::connect function, and see if what's
being passed in matches your ODBC setup...

hth (a bit)
Rob


Massimiliano Arione

2005-09-23, 3:58 am

Rob Agar wrote:
> actually it *can* be an array - maybe you need to read the code!


You're right.
Indeed, this line of code in DB.php fooled me:

718 * @param string $dsn Data Source Name to be parsed

--
Massimiliano Arione
:: http://garak.it ::
* No Word * http://gnu.org/philosophy/no-word-attachments.html
* No HTML * http://efn.no/html-bad.html
LinuXKiD

2005-09-23, 6:58 pm


From actual pear.php.net DB Manual:

$dsn = array(
'phptype' => false,
'dbsyntax' => false,
'username' => false,
'password' => false,
'protocol' => false,
'hostspec' => false,
'port' => false,
'socket' => false,
'database' => false,
);


[...]

bests




->
-> Rob Agar wrote:
-> > actually it *can* be an array - maybe you need to read the code!
->
-> You're right.
-> Indeed, this line of code in DB.php fooled me:
->
-> 718 * @param string $dsn Data Source Name to be parsed
->
-> --
-> Massimiliano Arione
-> :: http://garak.it ::
-> * No Word * http://gnu.org/philosophy/no-word-attachments.html
-> * No HTML * http://efn.no/html-bad.html
->
-> --
-> PEAR General Mailing List (http://pear.php.net/)
-> To unsubscribe, visit: http://www.php.net/unsub.php
->
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com