[Lazarus] SQLDB - Can't attach second SQLite database because transaction

Michael Van Canneyt michael at freepascal.org
Mon Jan 7 15:42:53 CET 2013



On Mon, 7 Jan 2013, Krzysztof wrote:

> Ok I found a hack. I created own TMyConnection = class(TSQLite3Connection) so I have access to protected execsql which don't check transaction:
> type
> 
>   { TMyConnection }
> 
>   TMyConnection = class(TSQLite3Connection)
>   public
>     procedure ExecSQLNoTrans(const ASql: String);
>   end;  
> 
> implementation
> 
> procedure TMyConnection.ExecSQLNoTrans(const ASql: String);
> begin
>   execsql(ASql);
> end;   
> 
> And now I can attach my second database by calling:
> 
>     DBConnection.ExecSQLNoTrans('attach database '+QuotedStr(GetConfigDir+'second.db')+' as mydb2');
> 
> Each system can be broken ;)

Maybe we should make a method for this in TSQLite3Connection ?

Michael.


More information about the Lazarus mailing list