Running a SQL Script

Posts   
 
    
hplloyd
User
Posts: 191
Joined: 29-Oct-2004
# Posted on: 09-Jun-2005 10:00:54   

I am nearing the end of my firebird application using LLBL and need to now build in the upgrade functionality so that user can upgrade to future versions as required.

As part of the upgrade routine I will be comparing the version of the application to the version of the database when the application starts... If the versions do not match then I will need to run a SQL script that will add/remove fields etc to get the versions to match...

My question is this.... If I store the script(s) as a text file, is there any way that I can use LLBL to execute the script(s) (through the DataAccessAdapter object), or do I have to consult the Firebird .NET Provider documentation - something that to date I have not needed to do becausse LLBL has handled all that for me wink

Many thanks in advance

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 09-Jun-2005 12:26:02   

Derive a class from DataAccessAdapter, then add a method to that class which calls CreateNewPhysicalConnection, to get a connection object. Using that connection object, you can execute FbCommand objects simple_smile

Frans Bouma | Lead developer LLBLGen Pro