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

View File

@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32901.82
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CmpRpt", "CmpRpt.csproj", "{C4293263-EA9C-11D6-8515-00A0CC271352}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C4293263-EA9C-11D6-8515-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4293263-EA9C-11D6-8515-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4293263-EA9C-11D6-8515-00A0CC271352}.Debug|x86.ActiveCfg = Debug|x86
{C4293263-EA9C-11D6-8515-00A0CC271352}.Debug|x86.Build.0 = Debug|x86
{C4293263-EA9C-11D6-8515-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4293263-EA9C-11D6-8515-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU
{C4293263-EA9C-11D6-8515-00A0CC271352}.Release|x86.ActiveCfg = Release|x86
{C4293263-EA9C-11D6-8515-00A0CC271352}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {14F0328F-5103-43E9-AFED-8510A6098931}
EndGlobalSection
EndGlobal