Forums

PHP

This topic is locked

Problem with Phakt and Access

Posted 04 Mar 2002 12:20:56
1
has voted
04 Mar 2002 12:20:56 Leon Radley posted:
Just got started with PHP and phakt and thought I set all the things up right but i get this error... ive got the newest php on win2kpro and the newest phakt and a access database(just for trying a little bit) the error I get is

Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in c:\inetpub\wwwroot\leon\adodb\adodb-odbc.inc.php on line 77

my connection file looks like this

<?php
/* FileName="Connection_php_direct.htm" "driver=sun.jdbc.odbc.JdbcOdbcDriver|url=jdbc<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>dbc:leonDSN|uid=|pword="
Type="JDBC"
Catalog=""
Schema=""
HTTP="false"
*/
if(!isset($PHP_SELF)){
$PHP_SELF=getenv("SCRIPT_NAME";
}
if (!isset($QUERY_STRING)){
$QUERY_STRING="";
}
if (!isset($REQUEST_URI)){
$REQUEST_URI=$PHP_SELF;
}
$MM_leonconnection_HOSTNAME = "leon";
$MM_leonconnection_DBTYPE = "access";
$MM_leonconnection_DATABASE = "guestbook";
$MM_leonconnection_USERNAME = "";
$MM_leonconnection_PASSWORD = "";
ADOLoadCode($MM_leonconnection_DBTYPE);
$leonconnection=&ADONewConnection($MM_leonconnection_DBTYPE);
if($MM_leonconnection_DBTYPE == "access" || $MM_leonconnection_DBTYPE == "odbc"{
$leonconnection-&gt;PConnect($MM_leonconnection_DATABASE, $MM_leonconnection_USERNAME,$MM_leonconnection_PASSWORD);
} else if($MM_leonconnection_DBTYPE == "ibase" {
$leonconnection-&gt;PConnect($MM_leonconnection_HOSTNAME.":".$MM_leonconnection_DATABASE,$MM_leonconnection_USERNAME,$MM_leonconnection_PASSWORD);
} else {
$leonconnection-&gt;PConnect($MM_leonconnection_HOSTNAME,$MM_leonconnection_USERNAME,$MM_leonconnection_PASSWORD,$MM_leonconnection_DATABASE);
}
?&gt;

why it doesn't work is a mystery to me.. tried changing alot of prefs but i get the same thing... hope someone knows whats wrong

Cheers

// Leon

Replies

Replied 07 Mar 2002 16:54:44
07 Mar 2002 16:54:44 Toomas Riim replied:
Have you set up any Microsoft database servers in order to use Access-based databases? You'd better use MySQL, it works perfectly with Phakt, UD.

Replied 25 Mar 2002 09:54:40
25 Mar 2002 09:54:40 Aurel Sorin Cirstoiu replied:
After you set up the DSN in your system, you must use the same name when connecting from PHAkt.And be sure you have created the DSN first.

----------------------
Cirstoiu Aurel Sorin
InterAKT Support
www.interakt.ro

Reply to this topic