[pmwiki-users] Database Standard and ADOdb

Ben Stallings ben at interdependentweb.com
Fri Mar 30 08:24:17 CDT 2007


SMETS Stephane BKS-IT wrote:
> I had try a little debuging. In adodb-mysql.inc.php, in the function
> _connect, if I print the 3 connection parameters Arghostname etc,
> they seems empty ! In adodb-connect.php, around line 101 when the
> program try to connect in //standard DSN connection, the $dsn is
> correctly filled up!

That's very peculiar.  Just a thought: are you defining $Databases in 
your config.php *before* you include dataquery.php?  If the variable is 
not defined when the script runs, that could cause this error... beyond 
that, I'm really not sure!

> And finaly (but I don't know if it help), I can
> work with a Msaccess database

No, that would not help.  To my knowledge no one has yet gotten 
DataQuery working with MS Access.  If you were the first, that would be 
fantastic, but you're more likely to succeed with MySQL.

> What do you think about oleDb ?

This is the first I've heard of it.  I rarely run PmWiki on Microsoft 
servers and so would not personally develop an interface to OLE DB, but 
if someone else were to write an equivalent to Database Standard that 
works with OLE DB, I'd adjust DataQuery to work with it.

> The account is used by another programs in Php and also Perl so...

...so that would appear not to be the problem.  Good.

My suggestion would be to create a simple PHP script to verify that 
ADOdb is working on your server.  If it is, then the problem is in 
Database Standard.  Here's an example, adapted from the ADOdb documentation:

<?php
include('adodb.inc.php');	   # load code common to ADOdb
$conn = &ADONewConnection('mysql');	# create a connection
$conn->PConnect('localhost','userid','password','database');
$recordSet = &$conn->Execute('select * from products');
if (!$recordSet)
	print $conn->ErrorMsg();
else
while (!$recordSet->EOF) {
	print $recordSet->fields[0].' '.$recordSet->fields[1].'<BR>';
	$recordSet->MoveNext();
}
?>

...being sure to change the file path, database info, and table name to 
match your setup.  Let me know what happens.  --Ben



More information about the pmwiki-users mailing list