Waldo Thompson
|
| Posted: 03/22/2002, 10:10 PM |
|
We have been attempting to use Codecharge to generate a PHP 4 with template version of the Bookstore on Apache, using the Access database included with the example. We've also tried downloading the sample PHP app and making the receommeded changes to the common.php file. No matter what we do, the following message always occurs:
Warning: SQL error: , SQL state 00000 in SQLConnect in c:\program files\apache group\apache\htdocs\bookstore\db_odbc.inc on line 35
Database error: Link-ID == false, odbc_pconnect failed
ODBC Error: 0 ()
Session halted.
|
|
|
 |
Nicole
|
| Posted: 03/23/2002, 1:46 AM |
|
Waldo,
don't be frustrating!
when you want to connect to an Access database using the PHP language, you have to create a system ODBC DSN name for the database. Use the ODBC options in control panels to create the DSN. Having created the ODBC DSN name, then within CodeCharge, go to the Database settings tab and in the 'Database Name' field, enter the name of the ODBC DSN you created. Also enter login and password information if you configured this. In the 'Host' field, enter localhost if your pages reside on the same machine where the DSN is created or enter the IP address of the machine where the DSN is created. You should then be able to connect to the database successfully.
And of course PHP should be installed with ODBC support.
|
|
|
 |
Waldo Thompson
|
| Posted: 03/23/2002, 7:44 AM |
|
Nicole,
Thanks for your reply. I have created a system dsn pointing to the Access
database, and the settings in Codecharge are precisely as you suggest. I generally am doing .NET development in C#, and both the ASP and ASP.NET Codecharge-generated applications work fine. (I had modify a few things in the C# version, but nothing major.) I would assume that PHP is installed with ODBC support as I am testing on the same machine that I do .NET development. However, I use IIS (Win2K) for ASP.NET (set at port 80), and Apache for Perl, PHP, etc. (set on port 8080). I have tried stopping IIS and setting Apache to port 80 (stopping and starting Apache of course), and still receive the same error.
Looking through the code, it all appears proper to me, but continues to die at line 35 of db_odbc.inc.
I'm puzzled...
Nicole
Date Created 3/23/02 1:46:25 AM
Message Waldo,
don't be frustrating!
when you want to connect to an Access database using the PHP language, you have to create a system ODBC DSN name for the database. Use the ODBC options in control panels to create the DSN. Having created the ODBC DSN name, then within CodeCharge, go to the Database settings tab and in the 'Database Name' field, enter the name of the ODBC DSN you created. Also enter login and password information if you configured this. In the 'Host' field, enter localhost if your pages reside on the same machine where the DSN is created or enter the IP address of the machine where the DSN is created. You should then be able to connect to the database successfully.
And of course PHP should be installed with ODBC support.
|
|
|
 |
|