UltraLite User's Guide
The Embedded SQL Interface
Library function reference
ul_bool ULDropDatabase ( SQLCA * sqlca, ul_char * store-parms );
Delete the UltraLite database file.
Caution This function deletes the database file and all data in it. Use with care. |
Do not call this function while a database connection is open. Call this function only before db_init or after db_fini.
On the Palm OS, call this function only after ULPalmExit or before ULPalmLaunch (but after any ULEnable functions have been called)
sqlca A pointer to the SQLCA.
store-parms A string of connection parameters, including the file name to delete as a keyword-value pair of the form file_name=file.udb. It is often convenient to use the UL_STORE_PARMS macro as this argument. A value of UL_NULL deletes the default database filename.
For more information, see UL_STORE_PARMS macro.
ul_true Indicates that database files was successfully deleted.
ul_false The detailed error message is defined by the sqlcode field in the SQLCA. The usual reason for failure is that an incorrect filename was supplied or that access to the file was denied, perhaps because it is opened by an application.
The following call deletes the UltraLite database file myfile.udb.
#define UL_STORE_PARMS UL_TEXT("file_name=myfile.udb") if( ULDropDatabase(&sqlca;, UL_STORE_PARMS ) ){ // success };