# -*- coding: iso-8859-1 -*- #. // _ba_CreateDatabase.py #. // Crée une database si elle n'existe pas. from os.path import isfile def ba_CreateDatabase( oServiceManager, cFileUrl ): cFile = cFileUrl cFile = cFile.replace( "file:///", "" ) cFile = cFile.replace( "/", "\\" ) cFile = cFile.replace( "%20", " " ) cFile = cFile.replace( "|", ":" ) if not isfile( cFile ): oContext = oServiceManager.createInstance( "com.sun.star.sdb.DatabaseContext" ) oDBase = oContext.createInstance() oDBase.URL = "sdbc:embedded:hsqldb" oDBase.DatabaseDocument.storeAsURL( cFileUrl, [] ) #. endif return 0 ''' Dernière modification : 2022-02-21 from _ba_CreateDatabase import ba_CreateDatabase # // Crée une database si elle n'existe pas. '''