diff --git a/PROMS/RoAccessToSql/App.config b/PROMS/RoAccessToSql/App.config
new file mode 100644
index 00000000..e702b746
--- /dev/null
+++ b/PROMS/RoAccessToSql/App.config
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PROMS/RoAccessToSql/Program.cs b/PROMS/RoAccessToSql/Program.cs
new file mode 100644
index 00000000..20a37fc6
--- /dev/null
+++ b/PROMS/RoAccessToSql/Program.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace RoAccessToSql
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main(string[] args)
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new RoAccessToSql(args));
+ }
+ }
+}
diff --git a/PROMS/RoAccessToSql/Properties/AssemblyInfo.cs b/PROMS/RoAccessToSql/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..6db08163
--- /dev/null
+++ b/PROMS/RoAccessToSql/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("RoAccessToSql")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("RoAccessToSql")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("ff85e109-0a0d-4dbd-8181-21d877549e8b")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/PROMS/RoAccessToSql/Properties/Resources.Designer.cs b/PROMS/RoAccessToSql/Properties/Resources.Designer.cs
new file mode 100644
index 00000000..0367b7b4
--- /dev/null
+++ b/PROMS/RoAccessToSql/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace RoAccessToSql.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RoAccessToSql.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/PROMS/RoAccessToSql/Properties/Resources.resx b/PROMS/RoAccessToSql/Properties/Resources.resx
new file mode 100644
index 00000000..af7dbebb
--- /dev/null
+++ b/PROMS/RoAccessToSql/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/PROMS/RoAccessToSql/Properties/Settings.Designer.cs b/PROMS/RoAccessToSql/Properties/Settings.Designer.cs
new file mode 100644
index 00000000..1569bf0e
--- /dev/null
+++ b/PROMS/RoAccessToSql/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace RoAccessToSql.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/PROMS/RoAccessToSql/Properties/Settings.settings b/PROMS/RoAccessToSql/Properties/Settings.settings
new file mode 100644
index 00000000..39645652
--- /dev/null
+++ b/PROMS/RoAccessToSql/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/PROMS/RoAccessToSql/RoAccessToSql.Designer.cs b/PROMS/RoAccessToSql/RoAccessToSql.Designer.cs
new file mode 100644
index 00000000..53cd8a8f
--- /dev/null
+++ b/PROMS/RoAccessToSql/RoAccessToSql.Designer.cs
@@ -0,0 +1,306 @@
+namespace RoAccessToSql
+{
+ partial class RoAccessToSql
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RoAccessToSql));
+ this.lblAccessPath = new System.Windows.Forms.Label();
+ this.tbAccessPath = new System.Windows.Forms.TextBox();
+ this.btnConvert = new System.Windows.Forms.Button();
+ this.btnExit = new System.Windows.Forms.Button();
+ this.btnBrowse = new DevComponents.DotNetBar.ButtonX();
+ this.panelExStatus = new DevComponents.DotNetBar.PanelEx();
+ this.pBarDbs = new DevComponents.DotNetBar.Controls.ProgressBarX();
+ this.pBarROs = new DevComponents.DotNetBar.Controls.ProgressBarX();
+ this.lblConvertStatusROs = new DevComponents.DotNetBar.LabelX();
+ this.lblConvertStatusDB = new DevComponents.DotNetBar.LabelX();
+ this.lblSqlDbName = new System.Windows.Forms.Label();
+ this.tbSqlDbName = new System.Windows.Forms.TextBox();
+ this.btnTestConnect = new DevComponents.DotNetBar.ButtonX();
+ this.lblSqlServerName = new System.Windows.Forms.Label();
+ this.tbSqlServerName = new System.Windows.Forms.TextBox();
+ this.groupPanel1 = new DevComponents.DotNetBar.Controls.GroupPanel();
+ this.panelExStatus.SuspendLayout();
+ this.groupPanel1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // lblAccessPath
+ //
+ this.lblAccessPath.AutoSize = true;
+ this.lblAccessPath.Location = new System.Drawing.Point(31, 9);
+ this.lblAccessPath.Name = "lblAccessPath";
+ this.lblAccessPath.Size = new System.Drawing.Size(167, 17);
+ this.lblAccessPath.TabIndex = 0;
+ this.lblAccessPath.Text = "Path to Access Database";
+ //
+ // tbAccessPath
+ //
+ this.tbAccessPath.Location = new System.Drawing.Point(48, 40);
+ this.tbAccessPath.Name = "tbAccessPath";
+ this.tbAccessPath.Size = new System.Drawing.Size(630, 22);
+ this.tbAccessPath.TabIndex = 2;
+ this.tbAccessPath.Leave += new System.EventHandler(this.tbAccessPath_Leave);
+ //
+ // btnConvert
+ //
+ this.btnConvert.Location = new System.Drawing.Point(635, 148);
+ this.btnConvert.Name = "btnConvert";
+ this.btnConvert.Size = new System.Drawing.Size(72, 29);
+ this.btnConvert.TabIndex = 4;
+ this.btnConvert.Text = "Convert";
+ this.btnConvert.UseVisualStyleBackColor = true;
+ this.btnConvert.Click += new System.EventHandler(this.btnConvert_Click);
+ //
+ // btnExit
+ //
+ this.btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnExit.Location = new System.Drawing.Point(635, 201);
+ this.btnExit.Name = "btnExit";
+ this.btnExit.Size = new System.Drawing.Size(75, 29);
+ this.btnExit.TabIndex = 5;
+ this.btnExit.Text = "Exit";
+ this.btnExit.UseVisualStyleBackColor = true;
+ this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
+ //
+ // btnBrowse
+ //
+ this.btnBrowse.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
+ this.btnBrowse.BackColor = System.Drawing.Color.Transparent;
+ this.btnBrowse.Image = ((System.Drawing.Image)(resources.GetObject("btnBrowse.Image")));
+ this.btnBrowse.Location = new System.Drawing.Point(698, 40);
+ this.btnBrowse.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+ this.btnBrowse.Name = "btnBrowse";
+ this.btnBrowse.Size = new System.Drawing.Size(21, 23);
+ this.btnBrowse.TabIndex = 40;
+ this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
+ //
+ // panelExStatus
+ //
+ this.panelExStatus.CanvasColor = System.Drawing.SystemColors.Control;
+ this.panelExStatus.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+ this.panelExStatus.Controls.Add(this.pBarDbs);
+ this.panelExStatus.Controls.Add(this.pBarROs);
+ this.panelExStatus.Controls.Add(this.lblConvertStatusROs);
+ this.panelExStatus.Controls.Add(this.lblConvertStatusDB);
+ this.panelExStatus.DisabledBackColor = System.Drawing.Color.Empty;
+ this.panelExStatus.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.panelExStatus.Location = new System.Drawing.Point(0, 255);
+ this.panelExStatus.Name = "panelExStatus";
+ this.panelExStatus.Size = new System.Drawing.Size(771, 135);
+ this.panelExStatus.Style.Alignment = System.Drawing.StringAlignment.Center;
+ this.panelExStatus.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
+ this.panelExStatus.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
+ this.panelExStatus.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
+ this.panelExStatus.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
+ this.panelExStatus.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
+ this.panelExStatus.Style.GradientAngle = 90;
+ this.panelExStatus.TabIndex = 45;
+ //
+ // pBarDbs
+ //
+ //
+ //
+ //
+ this.pBarDbs.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+ this.pBarDbs.Location = new System.Drawing.Point(34, 37);
+ this.pBarDbs.Name = "pBarDbs";
+ this.pBarDbs.Size = new System.Drawing.Size(656, 24);
+ this.pBarDbs.TabIndex = 4;
+ this.pBarDbs.TextVisible = true;
+ //
+ // pBarROs
+ //
+ //
+ //
+ //
+ this.pBarROs.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+ this.pBarROs.Location = new System.Drawing.Point(34, 99);
+ this.pBarROs.Name = "pBarROs";
+ this.pBarROs.Size = new System.Drawing.Size(656, 24);
+ this.pBarROs.TabIndex = 3;
+ this.pBarROs.TextVisible = true;
+ //
+ // lblConvertStatusROs
+ //
+ //
+ //
+ //
+ this.lblConvertStatusROs.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+ this.lblConvertStatusROs.Location = new System.Drawing.Point(14, 69);
+ this.lblConvertStatusROs.Name = "lblConvertStatusROs";
+ this.lblConvertStatusROs.Size = new System.Drawing.Size(128, 24);
+ this.lblConvertStatusROs.TabIndex = 2;
+ this.lblConvertStatusROs.Text = "Converting ROs:";
+ //
+ // lblConvertStatusDB
+ //
+ //
+ //
+ //
+ this.lblConvertStatusDB.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+ this.lblConvertStatusDB.Location = new System.Drawing.Point(14, 3);
+ this.lblConvertStatusDB.Name = "lblConvertStatusDB";
+ this.lblConvertStatusDB.Size = new System.Drawing.Size(226, 24);
+ this.lblConvertStatusDB.TabIndex = 0;
+ this.lblConvertStatusDB.Text = "Converting Database:";
+ //
+ // lblSqlDbName
+ //
+ this.lblSqlDbName.AutoSize = true;
+ this.lblSqlDbName.BackColor = System.Drawing.Color.Transparent;
+ this.lblSqlDbName.Location = new System.Drawing.Point(14, 0);
+ this.lblSqlDbName.Name = "lblSqlDbName";
+ this.lblSqlDbName.Size = new System.Drawing.Size(134, 17);
+ this.lblSqlDbName.TabIndex = 1;
+ this.lblSqlDbName.Text = "Sql Database Name";
+ //
+ // tbSqlDbName
+ //
+ this.tbSqlDbName.Location = new System.Drawing.Point(31, 31);
+ this.tbSqlDbName.Name = "tbSqlDbName";
+ this.tbSqlDbName.Size = new System.Drawing.Size(309, 22);
+ this.tbSqlDbName.TabIndex = 3;
+ this.tbSqlDbName.Leave += new System.EventHandler(this.tbSqlDbName_Leave);
+ //
+ // btnTestConnect
+ //
+ this.btnTestConnect.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
+ this.btnTestConnect.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
+ this.btnTestConnect.Location = new System.Drawing.Point(380, 44);
+ this.btnTestConnect.Name = "btnTestConnect";
+ this.btnTestConnect.Size = new System.Drawing.Size(105, 51);
+ this.btnTestConnect.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+ this.btnTestConnect.TabIndex = 39;
+ this.btnTestConnect.Text = "Test Connect";
+ this.btnTestConnect.Click += new System.EventHandler(this.btnTestConnect_Click);
+ //
+ // lblSqlServerName
+ //
+ this.lblSqlServerName.AutoSize = true;
+ this.lblSqlServerName.BackColor = System.Drawing.Color.Transparent;
+ this.lblSqlServerName.Location = new System.Drawing.Point(14, 69);
+ this.lblSqlServerName.Name = "lblSqlServerName";
+ this.lblSqlServerName.Size = new System.Drawing.Size(115, 17);
+ this.lblSqlServerName.TabIndex = 43;
+ this.lblSqlServerName.Text = "Sql Server Name";
+ //
+ // tbSqlServerName
+ //
+ this.tbSqlServerName.Location = new System.Drawing.Point(31, 100);
+ this.tbSqlServerName.Name = "tbSqlServerName";
+ this.tbSqlServerName.Size = new System.Drawing.Size(309, 22);
+ this.tbSqlServerName.TabIndex = 44;
+ this.tbSqlServerName.Leave += new System.EventHandler(this.tbSqlServerName_Leave);
+ //
+ // groupPanel1
+ //
+ this.groupPanel1.CanvasColor = System.Drawing.SystemColors.Control;
+ this.groupPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
+ this.groupPanel1.Controls.Add(this.lblSqlDbName);
+ this.groupPanel1.Controls.Add(this.tbSqlServerName);
+ this.groupPanel1.Controls.Add(this.btnTestConnect);
+ this.groupPanel1.Controls.Add(this.tbSqlDbName);
+ this.groupPanel1.Controls.Add(this.lblSqlServerName);
+ this.groupPanel1.DisabledBackColor = System.Drawing.Color.Empty;
+ this.groupPanel1.Location = new System.Drawing.Point(34, 84);
+ this.groupPanel1.Name = "groupPanel1";
+ this.groupPanel1.Size = new System.Drawing.Size(528, 160);
+ //
+ //
+ //
+ this.groupPanel1.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
+ this.groupPanel1.Style.BackColorGradientAngle = 90;
+ this.groupPanel1.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
+ this.groupPanel1.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
+ this.groupPanel1.Style.BorderBottomWidth = 1;
+ this.groupPanel1.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
+ this.groupPanel1.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
+ this.groupPanel1.Style.BorderLeftWidth = 1;
+ this.groupPanel1.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
+ this.groupPanel1.Style.BorderRightWidth = 1;
+ this.groupPanel1.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
+ this.groupPanel1.Style.BorderTopWidth = 1;
+ this.groupPanel1.Style.CornerDiameter = 4;
+ this.groupPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
+ this.groupPanel1.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
+ this.groupPanel1.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
+ this.groupPanel1.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
+ //
+ //
+ //
+ this.groupPanel1.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+ //
+ //
+ //
+ this.groupPanel1.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
+ this.groupPanel1.TabIndex = 56;
+ this.groupPanel1.Text = "SQL Connection";
+ //
+ // RoAccessToSql
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(771, 390);
+ this.Controls.Add(this.groupPanel1);
+ this.Controls.Add(this.panelExStatus);
+ this.Controls.Add(this.btnBrowse);
+ this.Controls.Add(this.btnExit);
+ this.Controls.Add(this.btnConvert);
+ this.Controls.Add(this.tbAccessPath);
+ this.Controls.Add(this.lblAccessPath);
+ this.Name = "RoAccessToSql";
+ this.Text = "Ro Convert MSAccess To Sql";
+ this.panelExStatus.ResumeLayout(false);
+ this.groupPanel1.ResumeLayout(false);
+ this.groupPanel1.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lblAccessPath;
+ private System.Windows.Forms.TextBox tbAccessPath;
+ private System.Windows.Forms.Button btnConvert;
+ private System.Windows.Forms.Button btnExit;
+ private DevComponents.DotNetBar.ButtonX btnBrowse;
+ private DevComponents.DotNetBar.PanelEx panelExStatus;
+ private DevComponents.DotNetBar.LabelX lblConvertStatusDB;
+ private System.Windows.Forms.Label lblSqlDbName;
+ private System.Windows.Forms.TextBox tbSqlDbName;
+ private DevComponents.DotNetBar.ButtonX btnTestConnect;
+ private System.Windows.Forms.Label lblSqlServerName;
+ private System.Windows.Forms.TextBox tbSqlServerName;
+ private DevComponents.DotNetBar.Controls.GroupPanel groupPanel1;
+ private DevComponents.DotNetBar.LabelX lblConvertStatusROs;
+ private DevComponents.DotNetBar.Controls.ProgressBarX pBarROs;
+ private DevComponents.DotNetBar.Controls.ProgressBarX pBarDbs;
+ }
+}
+
diff --git a/PROMS/RoAccessToSql/RoAccessToSql.cs b/PROMS/RoAccessToSql/RoAccessToSql.cs
new file mode 100644
index 00000000..9c2a23e4
--- /dev/null
+++ b/PROMS/RoAccessToSql/RoAccessToSql.cs
@@ -0,0 +1,616 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.IO;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Data.SqlClient;
+using System.Data.OleDb;
+using Volian.Base.Library;
+
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
+
+//RoAccessToSql is the program to be used to convert Referenced Object data that is stored in a Microsoft Access database to a sql database.
+// Input to this program is:
+// /acc=
+// /sqldb=
+// /server=
+// for example: 'RoAccessSql /acc=D:\Backup2012\APP\RO /sqldb=VEPROMS_APP /server=.\sqlexpress_2012'
+//
+// Some things to note:
+// 1) the database must exist in the server and must have the 'roall' table and stored procedures. It cannot have any data.
+// 2) no ro images are stored. These will continue to be used as before
+// 3) log4net is used for errors, it is stored in the same place as the Proms error log
+// 4) The program can be run standalone, but if run from Proms, the database name, server and romaster.mdb path will be initialized based on the rodb selected
+// 5) Data in sql is stored in only one table, 'roall'. It as a column for the table from which it came.
+
+namespace RoAccessToSql
+{
+ public partial class RoAccessToSql : Form
+ {
+ private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+ private string _MSAccessPath = null;
+ public string MSAccessPath
+ {
+ get { return _MSAccessPath; }
+ set { _MSAccessPath = value; }
+ }
+ private string _SqlServerName = null;
+ public string SqlServerName
+ {
+ get { return _SqlServerName; }
+ set { _SqlServerName = value; }
+ }
+ private string _SqlDatabaseName = null;
+ public string SqlDatabaseName
+ {
+ get { return _SqlDatabaseName; }
+ set { _SqlDatabaseName = value; }
+ }
+ bool _Initializing = false;
+
+ public RoAccessToSql(string[] args)
+ {
+ _Initializing = true;
+ InitializeComponent();
+
+ foreach (string parm in args) // get access & sql database info from program arguments, or use defaults
+ {
+ if (parm.StartsWith("/acc="))
+ {
+ MSAccessPath = parm.Substring(5);
+ }
+ else if (parm.StartsWith("/sqldb="))
+ {
+ SqlDatabaseName = parm.Substring(7) + "_RO";
+ }
+ else if (parm.StartsWith("/server="))
+ {
+ SqlServerName = parm.Substring(8);
+ }
+ }
+ if (MSAccessPath != null && !(Directory.Exists(MSAccessPath)))
+ {
+ MessageBox.Show("Invalid MS Access path, cannot convert. Fix before running conversion");
+ if (MSAccessPath != null) tbAccessPath.Text = MSAccessPath;
+ }
+ else
+ tbAccessPath.Text = MSAccessPath;
+ if (SqlServerName == null)
+ {
+ SqlServerName = @".\sqlserver";
+ }
+ tbSqlServerName.Text = SqlServerName;
+ if (SqlDatabaseName == null)
+ {
+ SqlDatabaseName = "VEPROMS_RO";
+ }
+ if (UserInRoEditor()) this.Close();
+ tbSqlDbName.Text = SqlDatabaseName;
+ _TmpFileForConnectStr = Path.GetTempPath();
+ _TmpFileForConnectStr = _TmpFileForConnectStr + @"\PromsConnect.txt";
+ File.Delete(_TmpFileForConnectStr);
+ _Initializing = false;
+ }
+
+ private bool UserInRoEditor()
+ {
+ FileInfo fiown = null;
+ FileStream fsown = null;
+ // The following code was taken from the roeditor. It uses the 'RoEditor.own' file to assure that
+ // no one is in the roeditor. This file is located in the microsoft access database directory.
+ try
+ {
+ string filename = MSAccessPath + @"\RoEditor.own";
+ fiown = new FileInfo(filename);
+ try
+ {
+ // Try to delete the owner file. If another process has the file open, this delete will fail.
+ // If the file is closed, it will be deleted, and the user will be placed in the editor. The users
+ // name and the time when this session began will be placed in the owner file.
+ fiown.Delete();
+ }
+ catch (Exception ex)
+ {
+ fsown = fiown.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+ TextReader tr1 = new StreamReader(fsown);
+ string who1 = tr1.ReadToEnd();
+ MessageBox.Show(ex.Message + "\r\n\r\n" + who1, "RO Editor In Use", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ }
+ fsown = fiown.Open(FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite);
+ TextReader tr = new StreamReader(fsown);
+ string who = tr.ReadToEnd();
+ tr.Close();
+ if (who.Contains(Environment.UserName.ToUpper()))
+ {
+ return true;
+ }
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(e.Message, "fileinfo");
+ }
+ // Open the file just specified. Open it so that no-one else can use it
+ try
+ {
+ fsown = fiown.Open(FileMode.Create, FileAccess.ReadWrite, FileShare.Read);
+ TextWriter tw = new StreamWriter(fsown);
+ tw.WriteLine("Current User: {0}, Date and Time Started: {1}", Environment.UserName.ToUpper(), DateTime.Now.ToString("MM/dd/yyyy @ hh:mm"));
+ tw.Flush();
+ }
+ catch (IOException ex)
+ {
+ fsown = fiown.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+ TextReader tr = new StreamReader(fsown);
+ string who = tr.ReadToEnd();
+ tr.Close();
+ if (!who.Contains(Environment.UserName.ToUpper()))
+ MessageBox.Show(who, "Another user is executing the RoEditor");
+ return true;
+ }
+ return false;
+ }
+ static string _ErrorLogFileName;
+ public static string ErrorLogFileName
+ {
+ get { return _ErrorLogFileName; }
+ set { _ErrorLogFileName = value; }
+ }
+ // make error log file name (uses same logic as proms error log)
+ static bool ChangeLogFileName(string AppenderName, string NewFilename)
+ {
+ log4net.Repository.ILoggerRepository RootRep;
+ RootRep = log4net.LogManager.GetRepository();
+ foreach (log4net.Appender.IAppender iApp in RootRep.GetAppenders())
+ {
+ if (iApp.Name.CompareTo(AppenderName) == 0
+ && iApp is log4net.Appender.FileAppender)
+ {
+ log4net.Appender.FileAppender fApp = (log4net.Appender.FileAppender)iApp;
+ string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
+ fApp.File = folderPath + @"\VEPROMS\" + (Volian.Base.Library.VlnSettings.GetCommand("prefix", "") + "_").TrimStart("_".ToCharArray()) + NewFilename;
+ ErrorLogFileName = fApp.File;
+ fApp.ActivateOptions();
+ return true;
+ }
+ }
+ return false;
+ }
+ // Browse to romaster.mdb (Microsoft access database)
+ private void btnBrowse_Click(object sender, EventArgs e)
+ {
+ FolderBrowserDialog fbd = new FolderBrowserDialog();
+ if (fbd.ShowDialog() == DialogResult.OK)
+ {
+ if (Directory.Exists(fbd.SelectedPath))
+ tbAccessPath.Text = fbd.SelectedPath;
+ else
+ MessageBox.Show("Path doesn't exist " + tbAccessPath.Text);
+ }
+ }
+ // Convert the data
+ private void btnConvert_Click(object sender, EventArgs e)
+ {
+ if (!Directory.Exists(tbAccessPath.Text))
+ {
+ MessageBox.Show("Invalid Path to Access Database", "Cannot convert data");
+ return;
+ }
+ bool canmigrate = TestConnection(false);
+ if (!canmigrate) return;
+ SetLogFileInfo();
+ this.Cursor = Cursors.WaitCursor;
+ MigrateData();
+ this.Cursor = Cursors.Default;
+ }
+ // Setup the log file, including the name and adding Session beginning info to the log file
+ private void SetLogFileInfo()
+ {
+ DateTime dtSunday = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek));
+
+ ChangeLogFileName("LogFileAppender", SqlDatabaseName + " " + dtSunday.ToString("yyyyMMdd") + " ErrorLog.txt");
+ _MyLog.InfoFormat("\r\nSession Beginning\r\n<===={0}[SQL:{1:yyMM.ddHH}]====== User: {2}/{3} Started {4} ===============>{5}"
+ , Application.ProductVersion, RevDate, DateTime.Now, Environment.UserDomainName, Environment.UserName, DateTime.Now.ToString("dddd MMMM d, yyyy h:mm:ss tt"), "");
+ }
+ private string _SqlConnectStr = null;
+ // Start the migration process, this method checks for valid connections and calls MigrateTables to actually migrate the data
+ private void MigrateData()
+ {
+ _SqlConnectStr = string.Format(@"Data Source={0};Initial Catalog={1};Integrated Security=True", SqlServerName, SqlDatabaseName);
+ using (SqlConnection sqlConnection = new SqlConnection(_SqlConnectStr))
+ {
+ try
+ {
+ sqlConnection.Open();
+ if (sqlConnection.State == ConnectionState.Open)
+ {
+ // now try to open access db:
+ string strDatabaseConnectionCommand = "Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";User ID=Admin;Data Source=" + MSAccessPath + "\\ROMaster.mdb;Mode=Share Deny None;Extended Properties=\"\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDB:Database Password=\"\";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False";
+ using (OleDbConnection accessConnection = new OleDbConnection(strDatabaseConnectionCommand))
+ {
+ try
+ {
+ accessConnection.Open();
+ if (accessConnection.State == ConnectionState.Open)
+ {
+ MigrateTables(accessConnection, sqlConnection);
+ if (accessConnection.State == ConnectionState.Open) accessConnection.Close();
+ }
+ }
+ catch (OleDbException ex)
+ {
+ _MyLog.Error("Access Connection failed.", ex);
+ MessageBox.Show(ex.Message, "Access Connection failed.");
+ }
+ }
+ if (sqlConnection.State == ConnectionState.Open) sqlConnection.Close();
+ }
+ else
+ {
+ _MyLog.Error("SQL Connection is not open. Check connection string: " + tbSqlDbName.Text);
+ MessageBox.Show("Check connection string: " + tbSqlDbName.Text, "SQL Connection is not open.");
+ }
+ }
+ catch (SqlException ex)
+ {
+ _MyLog.Error("SQL Connection is not open. Check connection string: " + tbSqlDbName.Text);
+ MessageBox.Show(ex.Message, "Unknown error when migrating RO data from MS Access to SQL");
+ }
+ }
+ }
+
+ private void MigrateTables(OleDbConnection accessConnection, SqlConnection sqlConnection)
+ {
+ DateTime lastTimeDbs = DateTime.Now;
+ DateTime lastTimeRos = DateTime.Now;
+ List allTables = new List();
+ List allTablesText = new List();
+ // set up the Progress bars. The top one is for the tables and the bottom one tracks ros as migrated for the current table.
+ int maxCntRo = GetRecordCountForTable("ROMaster", accessConnection);
+ lastTimeDbs = ProgressBarUpdate(pBarDbs, null, 0, 1, 0, 0, lastTimeDbs, false);
+ lastTimeRos = ProgressBarUpdate(pBarROs, null, 0, maxCntRo, 0, 0, lastTimeRos, false);
+ lastTimeDbs = ProgressBarUpdate(pBarDbs, "ROMaster Table", 0, 5, 0, 1, lastTimeDbs, false);
+ OleDbDataReader reader = null;
+ OleDbCommand command = new OleDbCommand("select * from ROMaster", accessConnection);
+ reader = command.ExecuteReader();
+ // Do access's romaster table first so that the list of other tables to process is found. While doing this, migrate this table's data.
+ int cntRo = 0;
+ int cntDb = 0;
+ int maxCntDb = 0;
+ while (reader.Read()) // reading from Access Database
+ {
+ string RecID = reader[0].ToString();
+ int RecType = int.Parse(reader[1].ToString());
+ string ParentID = reader[2].ToString();
+ string AccPageID = reader[3].ToString();
+ string ModDateTime = reader[4].ToString();
+ string Info = reader[5].ToString();
+ // Migrate the access record to sql
+ AddRecordToRoAll(sqlConnection, RecID, RecType, ParentID, AccPageID, ModDateTime, Info, "ROMASTER");
+ cntRo++;
+ lastTimeRos = ProgressBarUpdate(pBarROs, "ROMaster", 0, maxCntRo, cntRo, 1, lastTimeRos, true);
+ // store table names so that the progress bars can be managed. Table names are at end of rectype=1 info's field
+ if (RecType == 1)
+ {
+ int tabIndx = Info.LastIndexOf("\tRO");
+ string tname = Info.Substring(tabIndx);
+ allTables.Add(tname.Substring(1));
+ allTablesText.Add(Info.Substring(0, tabIndx));
+ maxCntDb++;
+ }
+ }
+ lastTimeRos = ProgressBarUpdate(pBarROs, "ROMaster", 0, maxCntRo, maxCntRo, 1, lastTimeRos, true);
+ lastTimeDbs = ProgressBarUpdate(pBarDbs, null, 0, maxCntDb, 0, 0, lastTimeDbs, false);
+ reader.Close();
+ reader = null;
+
+ // now migrate all the tables that were found
+ foreach (string tableName in allTables)
+ {
+ lastTimeRos = DateTime.Now;
+ cntRo = 0;
+ maxCntRo = GetRecordCountForTable(tableName, accessConnection);
+ lastTimeRos = DateTime.Now;
+ lastTimeRos = ProgressBarUpdate(pBarROs, null, 0, maxCntRo, 0, 0, lastTimeRos, true);
+ lastTimeDbs = ProgressBarUpdate(pBarDbs, allTablesText[cntDb], 0, maxCntDb, cntDb, 1, lastTimeDbs, false);
+ command = null;
+ command = new OleDbCommand("select * from " + tableName, accessConnection);
+ reader = command.ExecuteReader();
+ while (reader.Read()) // read all of the records from the current access table
+ {
+ string RecID = reader[0].ToString();
+ int RecType = int.Parse(reader[1].ToString());
+ string ParentID = reader[2].ToString();
+ string AccPageID = reader[3].ToString();
+ string ModDateTime = reader[4].ToString();
+ string Info = reader[5].ToString();
+ // Migrate to sql:
+ AddRecordToRoAll(sqlConnection, RecID, RecType, ParentID, AccPageID, ModDateTime, Info, tableName);
+ cntRo++;
+ lastTimeRos = ProgressBarUpdate(pBarROs, AccPageID, 0, maxCntRo, cntRo, 1, lastTimeRos, true);
+ }
+ cntDb++;
+ reader.Close();
+ reader = null;
+ lastTimeRos = ProgressBarUpdate(pBarROs, tableName, 0, maxCntRo, maxCntRo, 1, lastTimeRos, false);
+ }
+ lastTimeDbs = ProgressBarUpdate(pBarDbs, allTablesText[maxCntDb - 1], 0, maxCntDb, maxCntDb, 1, lastTimeDbs, false);
+ pBarDbs.Text = "Referenced Object Tables Migration Completed";
+ pBarROs.Text = "Referenced Objects Migration Completed";
+ btnConvert.Enabled = false;
+
+ // add a record to the access database so that proms/roeditor will know that the data has been converted.
+ UpdateAccessToFlagConverted(accessConnection);
+ // if called from proms, the database connection string must be stored in the rodb record. write the connection string
+ // out to a temporary file so the Proms can set this field in its database.
+ WriteSqlPathToTempFile();
+ }
+ private void UpdateAccessToFlagConverted(OleDbConnection accessConnection)
+ {
+ try
+ {
+ OleDbDataReader reader = null;
+ string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now);
+ string strInsert = "INSERT INTO ROMaster (RecID, RecType, ModDateTime, Info) ";
+ // note that '8' for rectype flags database converted:
+ strInsert = strInsert + " VALUES ('09999999', 8, '" + dt + "', '" + _SqlConnectStr + "');";
+ OleDbCommand command = new OleDbCommand(strInsert, accessConnection);
+ reader = command.ExecuteReader();
+ if (reader.Read()) return;
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(e.Message, "Error on insert to flag migration completed");
+ }
+ }
+ private string _TmpFileForConnectStr = null;
+ private void WriteSqlPathToTempFile()
+ {
+ System.IO.File.WriteAllText(_TmpFileForConnectStr, _SqlConnectStr);
+ }
+ // the following is used to update the progress bars, it finds how many records are in a table.
+ private int GetRecordCountForTable(string tableName, OleDbConnection accessConnection)
+ {
+ OleDbDataReader reader = null;
+ int retcnt = 100;
+ try
+ {
+ OleDbCommand command = new OleDbCommand("SELECT COUNT (RecID) as cnt FROM " + tableName, accessConnection);
+ reader = command.ExecuteReader();
+ if (reader.Read())
+ {
+ retcnt = reader.GetInt32(0);
+ }
+ reader.Close();
+ command.Dispose();
+ }
+ catch
+ {
+ }
+ return retcnt;
+ }
+ DateTime ProgressBarUpdate(DevComponents.DotNetBar.Controls.ProgressBarX pbi, string msg, int min, int max, int progress, int flag, DateTime lastUpdateDisplay, bool doTimeCheck)
+ {
+ if (flag == 0) // setup
+ pbi.Maximum = max;
+ else
+ {
+ if (doTimeCheck && lastUpdateDisplay != null && DateTime.Now.Subtract(lastUpdateDisplay).TotalSeconds < 0.25f) return lastUpdateDisplay;
+ if (progress == pbi.Maximum) pbi.Text = msg.Trim();
+ pbi.Value = progress;
+ pbi.Text = string.Format("Processing {0} ({1} of {2})", msg.Trim(), progress + 1, pbi.Maximum);
+ }
+ pbi.Refresh();
+ return DateTime.Now;
+ }
+ // Using the data as defined by the arguments, save the data to sql.
+ private void AddRecordToRoAll(SqlConnection sqlConnection, string RecID, int RecType, string ParentID, string AccPageID, string ModDateTime, string Info, string tableName)
+ {
+ try
+ {
+ SqlCommand command = new SqlCommand();
+ command.Connection = sqlConnection;
+ command.CommandType = CommandType.StoredProcedure;
+ command.CommandText = "insertAllRectypes";
+ command.Parameters.AddWithValue("@RecType", RecType);
+ if (AccPageID == null || AccPageID == "")
+ command.Parameters.AddWithValue("@AccPageID", string.Empty);
+ else
+ command.Parameters.AddWithValue("@AccPageID", AccPageID);
+ command.Parameters.AddWithValue("@ROTable", tableName);
+ command.Parameters.AddWithValue("@RecID", RecID);
+ command.Parameters.AddWithValue("@ParentID", ParentID);
+ command.Parameters.AddWithValue("@Info", Info);
+ command.Parameters.AddWithValue("@ModDateTime", ModDateTime);
+ using (SqlDataReader reader = command.ExecuteReader())
+ {
+ bool success = true;
+ }
+ command = null;
+ }
+ catch (Exception ex)
+ {
+ string msg = string.Format("Error when adding a record to the sql database for table {0} recid {1}", tableName, RecID);
+ _MyLog.Error(msg, ex);
+ }
+ }
+ private void btnExit_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+ // the user selected the button to test the sql connection string
+ private void btnTestConnect_Click(object sender, EventArgs e)
+ {
+ TestConnection(true);
+ }
+ // the RevDate & RevDescription are found in a stored procedure, vesp_GetSQLCodeRevision, in the sql database. These get updated each
+ // time a revision is made to the sql database using ROFixes.sql script.
+ private static DateTime _RevDate = DateTime.MinValue;
+ public static DateTime RevDate
+ {
+ get { return _RevDate; }
+ set { _RevDate = value; }
+ }
+ private static string _RevDescription = "Unknown";
+ public static string RevDescription
+ {
+ get { return _RevDescription; }
+ set { _RevDescription = value; }
+ }
+ // This is called to test the sql connection, either from the button when pressed by user, or from the convert button, before
+ // the conversion is done. See below for what is checked
+ private bool TestConnection(bool notifyUser)
+ {
+ // The following conditions must be true in order to migrate the ro data to sql. Only the first condition can be
+ // tested in this executable since the roall database is interfaced to by the roeditor & the program that migrates the data.
+ // The migration program will make the 2-4 tests, put up a message box if it cannot migrate & will send a failure back
+ // to this program, PROMS.
+ // 1) (done in proms to enable the migrate button) the rodb record's connection string must be 'cstring' (it is the connection string if data was migrated)
+ // 2) the roall database must exist when using the rodb record's connection string and this database must have the stored procedures
+ // 3) roall must be empty
+ // 4) the database must be the correct version
+ bool success = false;
+ bool dbsuc = false;
+ try
+ {
+ string conStr = string.Format(@"Data Source={0};Initial Catalog={1};Integrated Security=True", SqlServerName, SqlDatabaseName);
+ using (SqlConnection connection = new SqlConnection(conStr))
+ {
+ try
+ {
+ connection.Open();
+ if (connection.State == ConnectionState.Open)
+ {
+ // now see if there is an roall table
+ SqlCommand command = new SqlCommand();
+ command.Connection = connection;
+ command.CommandType = CommandType.Text;
+ command.CommandText = "(SELECT count(*) FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ROALL]') AND type in (N'U'))";
+ using (SqlDataReader reader = command.ExecuteReader())
+ {
+ if (reader.Read())
+ {
+ int count = reader.GetInt32(0);
+ if (count < 1)
+ {
+ MessageBox.Show("The database exists but does not have the required 'ROALL' table. Contact your DBA", "Invalid database");
+ dbsuc = false;
+ }
+ else
+ dbsuc = true;
+ }
+ }
+ success = dbsuc;
+ if (success)
+ {
+ // now see if there are stored procedures:
+ command = null; // reset command
+ command = new SqlCommand();
+ command.Connection = connection;
+ command.CommandType = CommandType.Text;
+ command.CommandText = "(SELECT count(*) FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteByROTable]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)";
+ using (SqlDataReader reader = command.ExecuteReader())
+ {
+ if (reader.Read())
+ {
+ int count = reader.GetInt32(0);
+ if (count < 1)
+ {
+ MessageBox.Show("The database exists but does not have the necessary stored procedures. Contact your DBA", "Invalid database");
+ dbsuc = false;
+ }
+ else
+ dbsuc = true;
+ }
+ }
+ success = dbsuc;
+ }
+ if (success)
+ {
+ // now test that the roall table is empty:
+ command = null; // reset command
+ command = new SqlCommand();
+ command.Connection = connection;
+ command.CommandType = CommandType.Text;
+ command.CommandText = "SELECT count(*) FROM roall";
+ using (SqlDataReader reader = command.ExecuteReader())
+ {
+ if (reader.Read())
+ {
+ int count = reader.GetInt32(0);
+ if (count > 0)
+ {
+ MessageBox.Show("The database already has data, cannot migrate additional data into it. Contact your DBA", "Invalid contents in database");
+ dbsuc = false;
+ }
+ else
+ dbsuc = true;
+ }
+ }
+ success = dbsuc;
+ }
+ if (success)
+ {
+ // now test that the database version is ok
+ command = null; // reset command
+ command = new SqlCommand();
+ command.Connection = connection;
+ command.CommandType = CommandType.StoredProcedure;
+ command.CommandText = "vesp_GetSQLCodeRevision";
+ using (SqlDataReader reader = command.ExecuteReader())
+ {
+ if (reader.Read())
+ {
+ _RevDate = reader.GetDateTime(0);
+ _RevDescription = reader.GetString(1);
+ dbsuc = true;
+ }
+ else
+ dbsuc = false;
+ }
+ success = dbsuc;
+ }
+ }
+ else
+ {
+ if (notifyUser) MessageBox.Show("Connection failed.", "Connection Failed");
+ }
+ }
+ catch (SqlException ex)
+ {
+ if (notifyUser) MessageBox.Show("Connection failed: " + ex, "Connection Failed");
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ if (notifyUser) MessageBox.Show("Connection failed: " + ex, "Connection Failed");
+ }
+
+ if (notifyUser && success) MessageBox.Show("You have been successfully connected to the database!", "Connection Succeeded");
+ return success;
+ }
+
+ private void tbSqlDbName_Leave(object sender, EventArgs e)
+ {
+ if (_Initializing) return;
+ SqlDatabaseName = tbSqlDbName.Text;
+ }
+
+ private void tbSqlServerName_Leave(object sender, EventArgs e)
+ {
+ if (_Initializing) return;
+ SqlServerName = tbSqlServerName.Text;
+ }
+
+ private void tbAccessPath_Leave(object sender, EventArgs e)
+ {
+ if (_Initializing) return;
+ MSAccessPath = tbAccessPath.Text;
+ }
+ }
+}
diff --git a/PROMS/RoAccessToSql/RoAccessToSql.csproj b/PROMS/RoAccessToSql/RoAccessToSql.csproj
new file mode 100644
index 00000000..0724d280
--- /dev/null
+++ b/PROMS/RoAccessToSql/RoAccessToSql.csproj
@@ -0,0 +1,101 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {1EC96BDA-01E7-4153-A95D-6A4A36FA278E}
+ WinExe
+ Properties
+ RoAccessToSql
+ RoAccessToSql
+ v4.6.1
+ 512
+
+ SAK
+ SAK
+ SAK
+ SAK
+
+
+ AnyCPU
+ true
+ full
+ false
+ ..\VEPROMS User Interface\bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+ ..\DataLoader\bin\Debug\log4net.dll
+
+
+
+
+
+
+
+
+
+
+
+
+ ..\Volian.Base.Library\bin\Debug\Volian.Base.Library.dll
+
+
+
+
+ Form
+
+
+ RoAccessToSql.cs
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+ RoAccessToSql.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PROMS/RoAccessToSql/RoAccessToSql.csproj.vspscc b/PROMS/RoAccessToSql/RoAccessToSql.csproj.vspscc
new file mode 100644
index 00000000..b6d32892
--- /dev/null
+++ b/PROMS/RoAccessToSql/RoAccessToSql.csproj.vspscc
@@ -0,0 +1,10 @@
+""
+{
+"FILE_VERSION" = "9237"
+"ENLISTMENT_CHOICE" = "NEVER"
+"PROJECT_FILE_RELATIVE_PATH" = ""
+"NUMBER_OF_EXCLUDED_FILES" = "0"
+"ORIGINAL_PROJECT_FILE_PATH" = ""
+"NUMBER_OF_NESTED_PROJECTS" = "0"
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
+}
diff --git a/PROMS/RoAccessToSql/RoAccessToSql.resx b/PROMS/RoAccessToSql/RoAccessToSql.resx
new file mode 100644
index 00000000..11d6b25d
--- /dev/null
+++ b/PROMS/RoAccessToSql/RoAccessToSql.resx
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
+ JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsDAAALAwFJjozSAAACeUlE
+ QVQ4T6WSWUiUURiG/4suurJIjUIwskQsEAMjqosQpUVNKbdCSRPKrQVDMddmXEedGdcpFXNGnUYdrSzF
+ sEIoFInQcqHE1CwoKsXUUMnt6XfEye0munjgnO+c9+HjO0cA/osNi2tJLdA6SXN13MwoI12lJ06uiV8+
+ W3d5IwIjVXiGKvwX11djSs2TRFlUito7ILIAoVab7SvCWhqrZYq1omXC4gpPe4Ur8AjNMQjo69IwPVZj
+ 4PeojtlhNfoyBXXalKSNBJ5hSjxCcnELzkeoKVcyNVq5Kjz/rZDZnggqSzOoKEpDXZBEcU4id+Sx5Mui
+ RcdfmVClyWLqh8YYXhDD9MVCT/CGrBPcK5Hx62uxMdxUm2XgiT6Tep2MhxVp6NXJ6IqllKlucTc3niJl
+ LKqsGINMqChOY+JTnqHtwRYJdZVK5gelMJSymo9ibSAOeiPhXTid1T5cD3IvF9SqZMb7M+CznEdVCtqe
+ ypcurWz9bQC0ezHX6sr0M0c+lNtx5cKJcVGwXyjJlfDzvZSh1gTqdHIWBiTQHbIU7AwSg+eYa3Nnuvk4
+ E41HGak9gDTUmvPOZjmGGRQqExjpiuG+NouOl2InvRGi4BJ0+LPw6gwzL04x2XSM0ToHvlfZ0p66FT9X
+ KxxsTGwMAlVmLN3NiTzQZkJ/IrwR233tzUyLG5PPHRmrP8Sw3o4vmr30yE2RBO/Bfp9Fg/EV8tKjqSnL
+ oOdxGO3ZgpE2+SaaZZtpSNpCdbw56mgLbt/YhZ/L7oVD9pYuRkF2ShTZksukxwQSd813cbJc9HHm7MnD
+ OB2x46CdNbZWFljuNGP7NhN2mJqIuRX/YOXm30H4A70P0TsBWkcYAAAAAElFTkSuQmCC
+
+
+
\ No newline at end of file