Connecting $db->databaseType...";
if (@$db->PConnect("susetikus","tester","test","test")) {
testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date)");
}else
print "ERROR: PostgreSQL requires a database called test on server susetikus, user tester, password test.
".$db->ErrorMsg();
}
if (!empty($testibase)) {
$db = &ADONewConnection('ibase');
print "
Connecting $db->databaseType...
";
if (@$db->PConnect("localhost:e:\\interbase\\examples\\database\\employee.gdb", "sysdba", "masterkey", ""))
testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname char(24),created date)");
else print "ERROR: Interbase test requires a database called employee.gdb".'
'.$db->ErrorMsg();
}
// REQUIRES ODBC DSN CALLED nwind
if (!empty($testaccess)) {
$db = &ADONewConnection('access');
print "Connecting $db->databaseType...
";
if (@$db->PConnect("nwind", "", "", ""))
testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
else print "ERROR: Access test requires a Windows ODBC DSN=nwind, Access driver";
}
if (!empty($testaccess) && !empty($testado)) { // ADO ACCESS
$db = &ADONewConnection("ado_access");
print "Connecting $db->databaseType...
";
$access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
$myDSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
. 'DATA SOURCE=' . $access . ';';
//. 'USER ID=;PASSWORD=;';
if (@$db->PConnect($myDSN, "", "", "")) {
print "ADO version=".$db->_connectionID->version."
";
testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
} else print "ERROR: Access test requires a Access database $access".'
'.$db->ErrorMsg();
}
if (!empty($testvfp)) { // ODBC
$db = &ADONewConnection('vfp');
print "Connecting $db->databaseType...
";
if (@$db->PConnect("logos2", "", "", ""))
testdb($db,"create table d:\\inetpub\\wwwroot\\logos2\\data\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
else print "ERROR: Visual FoxPro test requires a Windows ODBC DSN=logos2, VFP driver";
}
// REQUIRES MySQL server at localhost with database 'test'
if (!empty($testmysql)) { // MYSQL
$db = &ADONewConnection('maxsql');
print "Connecting $db->databaseType...
";
if ($HTTP_SERVER_VARS['HTTP_HOST'] == 'localhost') $server = 'localhost';
else $server = "mangrove";
if ($db->PConnect($server, "root", "", "test"))
testdb($db,
"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'
'.$db->ErrorMsg();
$db = &ADONewConnection('proxy');
print "Connecting $db->databaseType...
";
if ($HTTP_SERVER_VARS['HTTP_HOST'] == 'localhost') $server = 'localhost';
if ($db->PConnect('http://localhost/php/phplens/adodb/server.php'))
testdb($db,
"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'
'.$db->ErrorMsg();
}
ADOLoadCode('oci805');
ADOLoadCode("oci8po");
if (!empty($testoracle)) {
$db = ADONewConnection();
print "Connecting $db->databaseType...
";
if ($db->Connect('', "scott", "tiger",'natsoft.ecosystem.natsoft.com.my'))
//if ($db->PConnect("", "scott", "tiger", "juris.ecosystem.natsoft.com.my"))
testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
else print "ERROR: Oracle test requires an Oracle server setup with scott/tiger".'
'.$db->ErrorMsg();
}
ADOLoadCode("oracle"); // no longer supported
if (false && !empty($testoracle)) {
$db = ADONewConnection();
print "Connecting $db->databaseType...
";
if ($db->PConnect("", "scott", "tiger", "natsoft.domain"))
testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
else print "ERROR: Oracle test requires an Oracle server setup with scott/tiger".'
'.$db->ErrorMsg();
}
ADOLoadCode("odbc_mssql");
if (!empty($testmssql) and false) { // MS SQL Server via ODBC
$db = ADONewConnection();
print "Connecting $db->databaseType...
";
if (@$db->PConnect("sqlserver", "sa", "natsoft", ""))
testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN='sqlserver', userid='sa', password='natsoft'";
}
ADOLoadCode("ado_mssql");
if (!empty($testmssql) && !empty($testado) ) { // ADO ACCESS MSSQL -- thru ODBC -- DSN-less
$db = &ADONewConnection("ado_mssql");
print "Connecting DSN-less $db->databaseType...
";
$myDSN="PROVIDER=MSDASQL;DRIVER={SQL Server};"
. "SERVER=(local);DATABASE=NorthWind;UID=sa;PWD=natsoft;" ;
if (@$db->PConnect($myDSN, "", "", ""))
testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='mangrove', userid='sa', password='natsoft', database='ai'";
}
ADOLoadCode("mssql");
if (!empty($testmssql)) { // MS SQL Server -- the extension is buggy -- probably better to use ODBC
$db = ADONewConnection();
print "Connecting $db->databaseType...
";
$db->Connect('(local)\NetSDK','','','northwind');
if (true or @$db->PConnect("mangrove", "sa", "natsoft", "ai")) {
AutoDetect_MSSQL_Date_Order($db);
testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
} else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='192.168.0.1', userid='sa', password='natsoft', database='ai'".'
'.$db->ErrorMsg();
}
if (!empty($testmssql) && !empty($testado)) { // ADO ACCESS MSSQL with OLEDB provider
$db = &ADONewConnection("ado_mssql");
print "Connecting DSN-less OLEDB Provider $db->databaseType...
";
$myDSN="SERVER=mangrove;DATABASE=ai;";
//$myDSN='SERVER=(local)\NetSDK;DATABASE=northwind;';
if ($db->PConnect($myDSN, "sa", "natsoft", 'SQLOLEDB'))
testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='mangrove', userid='sa', password='', database='ai'";
}
print "Tests Completed
";
?>