PHAkt and Access database, is it possible?
Is it possible to use an Access database with Interakts Phakt PHP Server Model?
PHAkt 0.8+ supports Access. This FAQ was posted when those versions of PHAkt weren't available and so this post is a littlebit out dated.
Answer (by Waldo@UDzone.com):
PHAkt 0.6.6 has lots of predefined database connections. However a connection to an Access database is not available. You should modify the connections extension file yourself to be able to connect to an Access database.
On a windows machine go the the Dreamweaver Ultradev installation folder (it's often /program files/macromedia/dreamweaver ultradev 4/) and edit the file \Configuration\Connections\PHP\Win\Connection_php_direct.htm
At line 66-67 you'll see this html options menu code:
<select name="dbtype" style="width:150px;top:14px">
<option value="postgres7">PostgreSQL 7.x</option>
<option value="mysql">MySQL</option>
<option value="mysqlt">MaxSQL(MySQL transact)</option>
<option value="oci8">Oracle OCI 8</option>
<option value="oracle">Oracle non OCI</option>
<option value="mssql">MsSQL</option>
<option value="ado">ADO</option>
<option value="odbc">ODBC</option>
<option value="postgres">Postgres 6.5</option>
<option value="sybase">Sybase</option>
</select>
Change that to:
<select name="dbtype" style="width:150px;top:14px">
<option value="access">Access</option>
<option value="postgres7">PostgreSQL 7.x</option>
<option value="mysql">MySQL</option>
<option value="mysqlt">MaxSQL(MySQL transact)</option>
<option value="oci8">Oracle OCI 8</option>
<option value="oracle">Oracle non OCI</option>
<option value="mssql">MsSQL</option>
<option value="ado">ADO</option>
<option value="odbc">ODBC</option>
<option value="postgres">Postgres 6.5</option>
<option value="sybase">Sybase</option>
</select>
Save the file, restart ultradev and now you can define your connection. You should be able to connect to access now. Thanks to Tom Muck who gave me this trick a few weeks ago.
Comments
ERROR
Fatal error: Call to undefined function: adodb() in C:\Inetpub\wwwroot\php\adodb\adodb.inc.php on line 28
-----------
This after all the other bugs where squashed and the coffeepot died...
I have went through this situation in which every thing worked great when working w/in UD, but when you view live or view in localhost...this.
I wonder, do I need to set this up on a server to accurately execute the php, or should this work off of PWS?
---------------
RE: ERROR
/**
* SET THE VALUE BELOW TO THE DIRECTORY WHERE THIS FILE RESIDES
* ADODB_RootPath has been renamed ADODB_DIR
*/
if (!isset($ADODB_DIR))
$ADODB_DIR = adodb(__FILE__);
/** This is line 28(above) the (__FILE__) is causing the error and being undefined. I have tried listing the ` $ADODB_DIR = ` to : A.)Absolute path B.) Relative C.) root D.) All the above
.........
RE: RE: ERROR
If you use the latest version of my extension 'ADODB installer v1.01' in Extensions/App Servers/PHP you won't need to make this manual alteration. This extension uses the latest version of ADODB (v1.01) which automagically works the Document Path out for you.
Alternatively, you can download ADODB v1.01 from http://php.weblogs.com/ADODB.
However, if you do decide to use my extension you will find that whenever ADODB is upgraded, I will upgrade the extension and you can re-apply it at any time to upgrade the version of ADODB in your site painlessly :-)
And to make life that little bit easier, you will always know what version of ADODB you are running because the version number of my extension will be the same as the ADODB version.
Shameless plug I know, but I hope this helps.
Access,DSN - less Connections & Linux Servers
It should also be noted that if your site is hosted on a Linux / Unix server running PHP, and it does not have UnixODBC installed (or similar) you won't be able to make a connection to an Access database.
This is because the current implementation of ODBC in PHP is buggy, and PHP cannot make a successful connection to an Access Database.
If you are running on a Windows-based server then there is no problem, as ADODB makes use of the ADO COM Component, and will successfully connect.
I mention this here, purely for the sake of completeness of this great article.
For further information regarding this subject see http://php.weblogs.com/odbc
You must me logged in to write a comment.