/[AnywhereTS-MSSQL]/trunk/TSAdminTool/Database.cs
ViewVC logotype

Diff of /trunk/TSAdminTool/Database.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/TSAdminTool/Database.cs	2012/07/16 11:43:29	175
+++ trunk/TSAdminTool/Database.cs	2012/07/16 11:49:13	176
@@ -232,7 +232,9 @@
         {
             ErrorInfo = null;
             string cmd = strFile;
-            //cmd = cmd.Replace("[DataDir]", ProSupport.strDatabasePath);
+            #if HAVE_FRMCONFIGMODE
+            cmd = cmd.Replace("[DataDir]", ProSupport.strDatabasePath);
+#endif
             con.RunScript(cmd, out ErrorInfo);
             return false;
         }
@@ -495,28 +497,28 @@
 
 
 
-
-        //[Obsolete("SetDatabaseRights() has been deperecated - user rights are assigned via SQL Server", true)]
-        //public static void SetDatabaseRights()
-        //{
-        //    try
-        //    {
-        //        // Add an access control entry to the database file.
-        //        //ProSupport.GrantRWaccessForRemoteDesktopUsers(ProSupport.strDatabasePath + @"\" + ProSupport.strDatabaseFilename);
-        //        //ProSupport.GrantRWaccessForRemoteDesktopUsers(ProSupport.strDatabasePath + @"\" + ProSupport.strDatabaseFilename2);
-        //    }
-        //    catch (Exception e)
-        //    {
-        //        MessageBox.Show("Cannot set access rights for users to the database. Do you have the sufficient rights? Application will abort. Error: " + e.Message);
-        //        using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
-        //        {
-        //            Logging.DatabaseLog.Fatal("Cannot set access rights for users to the database.");
-        //        }
-        //        Application.Exit();
-        //        return;
-        //    }
-        //}
-
+        #if HAVE_FRMCONFIGMODE
+        [Obsolete("SetDatabaseRights() has been deperecated - user rights are assigned via SQL Server", true)]
+        public static void SetDatabaseRights()
+        {
+            try
+            {
+                // Add an access control entry to the database file.
+                ProSupport.GrantRWaccessForRemoteDesktopUsers(ProSupport.strDatabasePath + @"\" + ProSupport.strDatabaseFilename);
+                ProSupport.GrantRWaccessForRemoteDesktopUsers(ProSupport.strDatabasePath + @"\" + ProSupport.strDatabaseFilename2);
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show("Cannot set access rights for users to the database. Do you have the sufficient rights? Application will abort. Error: " + e.Message);
+                using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
+                {
+                    Logging.DatabaseLog.Fatal("Cannot set access rights for users to the database.");
+                }
+                Application.Exit();
+                return;
+            }
+        }
+#endif
         public static void StartSQLbrowserService()
         {
             System.ServiceProcess.ServiceController srvController = new System.ServiceProcess.ServiceController(SQL_BROWSER_SERVICE_NAME);

 

  ViewVC Help
Powered by ViewVC 1.1.22