222 |
|
public bool RunScript(string strFile, MsSqlConnector con, out Exception ErrorInfo) |
223 |
|
{ |
224 |
|
ErrorInfo = null; |
225 |
< |
string cmd = strFile.Replace("[DataDir]", ProSupport.strDatabasePath); |
225 |
> |
string cmd = strFile; |
226 |
> |
//cmd = cmd.Replace("[DataDir]", ProSupport.strDatabasePath); |
227 |
|
con.RunScript(cmd, out ErrorInfo); |
228 |
|
return false; |
229 |
|
} |
470 |
|
|
471 |
|
|
472 |
|
|
473 |
< |
[Obsolete("SetDatabaseRights() has been deperecated - user rights are assigned via SQL Server")] |
474 |
< |
public static void SetDatabaseRights() |
475 |
< |
{ |
476 |
< |
try |
477 |
< |
{ |
478 |
< |
// Add an access control entry to the database file. |
479 |
< |
ProSupport.GrantRWaccessForRemoteDesktopUsers(ProSupport.strDatabasePath + @"\" + ProSupport.strDatabaseFilename); |
480 |
< |
ProSupport.GrantRWaccessForRemoteDesktopUsers(ProSupport.strDatabasePath + @"\" + ProSupport.strDatabaseFilename2); |
481 |
< |
} |
482 |
< |
catch (Exception e) |
483 |
< |
{ |
484 |
< |
MessageBox.Show("Cannot set access rights for users to the database. Do you have the sufficient rights? Application will abort. Error: " + e.Message); |
485 |
< |
using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
486 |
< |
{ |
487 |
< |
Logging.ATSAdminLog.Fatal("Cannot set access rights for users to the database."); |
488 |
< |
} |
489 |
< |
Application.Exit(); |
490 |
< |
return; |
491 |
< |
} |
492 |
< |
} |
473 |
> |
//[Obsolete("SetDatabaseRights() has been deperecated - user rights are assigned via SQL Server", true)] |
474 |
> |
//public static void SetDatabaseRights() |
475 |
> |
//{ |
476 |
> |
// try |
477 |
> |
// { |
478 |
> |
// // Add an access control entry to the database file. |
479 |
> |
// //ProSupport.GrantRWaccessForRemoteDesktopUsers(ProSupport.strDatabasePath + @"\" + ProSupport.strDatabaseFilename); |
480 |
> |
// //ProSupport.GrantRWaccessForRemoteDesktopUsers(ProSupport.strDatabasePath + @"\" + ProSupport.strDatabaseFilename2); |
481 |
> |
// } |
482 |
> |
// catch (Exception e) |
483 |
> |
// { |
484 |
> |
// MessageBox.Show("Cannot set access rights for users to the database. Do you have the sufficient rights? Application will abort. Error: " + e.Message); |
485 |
> |
// using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString()))) |
486 |
> |
// { |
487 |
> |
// Logging.ATSAdminLog.Fatal("Cannot set access rights for users to the database."); |
488 |
> |
// } |
489 |
> |
// Application.Exit(); |
490 |
> |
// return; |
491 |
> |
// } |
492 |
> |
//} |
493 |
|
|
494 |
|
public static void StartSQLbrowserService() |
495 |
|
{ |