From: <meg...@ya...> - 2004-02-04 05:30:28
|
Hello Carlos, Thanx for ur prompt reply. I also tried this code before posting my previous mail. But this also gives me the same error. If I execute this code in a simple commandline utility, it doesn't gives me any error. Sample : class FbBackupRestore { public static vois Main(){ // 1. // 2. // 3. Yesterday's posted code, with or without the changes u've added } } But suppose I execute a query at the placeholder 1 in the above code, the error comes. I realise that there may be some connection left open, even when I Dispose() and nullify FbConnection and FbCommand objects. I know that only when the GC executes, will this be freed, but then what else could be done to execute backup/restore. At the placeholder 2 in the above code, I tried this code as well. FbConfiguration objFbConfiguration = new FbConfiguration(); objFbConfiguration.UserName = user; objFbConfiguration.UserPassword = password; objFbConfiguration.Database = dbfile; objFbConfiguration.DatabaseShutdown(FbShutdownMode.Forced,0); Thread.Sleep(2000); objFbConfiguration.DatabaseOnline(); Now the first error number changes from 190 to 31 and the remaining error numbers(i.e. : 130 & 233) remains the same, with the same messages for all of them(i.e. : 'No message found for this error number'). Is anything else required to mount and unmount the database? Waiting for reply. Thanx once a'ain, Mahesh. Carlos_Guzmán_Álvarez <car...@te...> wrote: Hello: > Can u give me any idea, why this could be happen? Huummmm .... Can you make a little test ?? anything like this: FbBackup objFbBackup = new FbBackup(); objFbBackup.UserName = user; objFbBackup.UserPassword = password; objFbBackup.Database = dbFile; objFbBackup.BackupFiles.Add(new FbBackupFile(dbBackFile, 4096)); objFbBackup.Options = FbBackupFlags.IgnoreLimbo; objFbBackup.Verbose = true; objFbBackup.Start(); while((lineOutput = objFbBackup.GetNextLine()) != null) { // Console.WriteLine(lineOutput); } objFbBackup.Close(); FbRestore objFbRestore = new FbRestore(); objFbRestore.UserName = user; objFbRestore.UserPassword = password; objFbRestore.Database = dbFile; objFbRestore.BackupFiles.Add(new FbBackupFile(dbBackFile, 4096)); objFbRestore.PageSize= 4096; objFbRestore.Options = FbRestoreFlags.Replace; objFbRestore.Verbose = true; objFbRestore.Start(); while((lineOutput = objFbRestore.GetNextLine()) != null) { // Console.WriteLine(lineOutput); } objFbRestore.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.WriteLine("Finished!!"); Console.ReadLine(); -- Best regards Carlos Guzmán Álvarez Vigo-Spain --------------------------------- BT Yahoo! Broadband - Free modem offer, sign up online today and save £80 |