Hi list, For a fpcunit database test listener I'm implementing multi-connector support using TSQLConnector. This seems to work nicely.
If the Firebird connector is chosen and the hostname is empty, I assume Firebird embedded is used and if not present, a database needs to be created using .CreateDB For this, I need TIBConnection-specific CreateDB. Currently I've managed to do that with the Proxy property of the TSQLConnector, which however is protected. Also it appears CheckProxy is needed: { THackSQLConnector } THackSQLConnector = class(TSQLConnector) //we really only want access to a working proxy private function GetProxyConnector: TSQLConnection; public Property ProxyConnection : TSQLConnection Read GetProxyConnector; end; function THackSQLConnector.GetProxyConnector: TSQLConnection; begin CheckProxy; //seems to be required to get valid proxy result:=inherited Proxy; end; and var FConn: THackSQLConnector; ... IBConn:TIBConnection; ... IBConn:=TIBConnection(FConn.ProxyConnection); IBConn.UserName:=FConn.UserName; IBConn.Password:=FConn.Password; IBConn.DatabaseName:=FConn.DatabaseName; ... IBConn.CreateDB; Is that the best/easiest way? Would it make sense to make the proxy code in TSQLConnector public? _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal