Hi All,
[quote="shacky":k1mvqr8i]
epesi uses static DB class, so you cannot make new instance of this class with other database as backend.
[/quote:k1mvqr8i]
Sorry, I missed this fact.
[quote="shacky":k1mvqr8i]
Connection is established before any module processing, so in module you are already connected. There is no pretty solution.... But you can hack it this way: DB class has public static $ado attribute, it is adodb connection class instance used by DB class. You can override it for a while:
$tmp = DB::$ado;
DB::$ado = & NewADOConnection(<your driver>);
DB::$ado->autoRollback = true; // default is false
if(!DB::$ado->Connect(<your host>, <your user>, <your pwd>, <your db name>))
trigger_error("Connect to database failed",E_USER_ERROR);
.... here you can use DB class as usual, but it operates on your database....
DB::Disconnect(); //disconnects your database
DB::$ado = $tmp;
[/quote:k1mvqr8i]
Very clever and ellegant 🙂
Many thanks Paul! 😃
Best regards,
Artur