B2023-120 If the path to the ROMaster DB contains spaces the copy process fails when transfer RO data to SQL along the some house keeping chech ins.

This commit is contained in:
2023-11-30 11:01:27 -05:00
parent 7e3ffffd9a
commit 57e43fe5d7
8 changed files with 167 additions and 43 deletions

View File

@@ -24,6 +24,7 @@
using System;
using System.Drawing;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
@@ -140,11 +141,26 @@ namespace CmpRpt
// for the Access database.
string roIdArg = BuildROList(args);
string[] roIDList = roIdArg.Split(',');
if (args.Length == 2 || args.Length == 3)
{
// If the args array contains more than 3 elements remove the extra ones. The fourth argument (PC=...) is handled in the BuildROList
// method above. If the args array contains more than 3 elements the working dir will not be correctly be set and the report will fail.
// The calling code file (DisplayReports.cs) at this time will only send up to 4 args.
//List<string> args2 = new List<string>(args);
//for (int i = 0; i < args2.Count; i++)
// {
// if (i > 2) {
// args2.RemoveAt(i);
// }
// }
////args2.RemoveAt(3);
//args = args2.ToArray();
//if (args.Length == 2 || args.Length == 3)
//{
string path = args[0];
Directory.SetCurrentDirectory(path);
}
//}
if (SqlConnectionStr != null)
myrodb = new SqlRODB(Directory.GetCurrentDirectory(), SqlConnectionStr, false);
else