View Single Post
  #3 (permalink)  
Old June 24th, 2009, 08:40 AM
RobCarter RobCarter is offline
Authorized User
 
Join Date: Nov 2005
Location: Bromsgrove, United Kingdom.
Posts: 41
Thanks: 6
Thanked 1 Time in 1 Post
Send a message via MSN to RobCarter
Question

Its the process.start that generates the error - The exe file opens a console window but then the console app code is shown in the debugger with the error in the declarations:

Code:
Module mCosting
PrivateConst sSource = "\\Server\f$\dir\"
Private sDest AsString = "\\Server\f$\dir\sdir\" & Format(Today, "yyyyMMdd") & "\"
PrivateConst sFileSource = "\\correctfilepath"
PrivateConst sFileDest = "\\correctfilepath"
Public myFYst AsInteger = FiscalYearStartMonth.Apr
Public dtpEnd AsString = Format(DateAdd(DateInterval.Day, -1, Today), "yyyyMMdd")
Public dtpStart AsString = fiscalYear(myFYst, Today()) & Right("00" & myFYst, 2) & "01"
Sub Main()
'Console.WriteLine("Current user: " & WindowsIdentity.GetCurrent().Name)
Dim context AsNew WrapperImpersonationContext("domain", "user", "pwd")
context.Enter()
' Execute code under other uses context 
Console.WriteLine("Current user: " & WindowsIdentity.GetCurrent().Name)
GetSheetToUnprotect("Immunology", "myeloma")
'backup last months files
Archive(sSource, sDest)
runDTS("DTS_Export_OutpatientFeed", dtpStart, dtpEnd) '"20080401", "20090331")' 
runDTS("DTS_Export_InpatientFeed", dtpStart, dtpEnd) '"20080401", "20090331")' 
runDTS("DTS_Export_AlliedFeed", dtpStart, dtpEnd) '"20080401", "20090331")'
runDTS("DTS_Export_ProsthesisFeed", dtpStart, dtpEnd) '"20080401", "20090331")'
runDTS("DTS_Export_WastedProsthesisFeed", dtpStart, dtpEnd) '"20080401", "20090331")
runDTS("DTS_Export_RadiologyFeed", dtpStart, dtpEnd) '"20080401", "20090331")'
runDTS("DTS_Export_WardFeed", dtpStart, dtpEnd) '"20080401", "20090331")'
runDTS("DTS_Export_TheatreFeed", dtpStart, dtpEnd) '"20080401", "20090331")'
runDTS("DTS_Export_EndoscopyFeed", dtpStart, dtpEnd) '"20080401", "20090331")'
runDTS("DTS_Export_PathologyFeed", dtpStart, dtpEnd) '"20080401", "20090331") '
runDTS("DTS_Export_ROCSFeed", dtpStart, dtpEnd) '"20080401", "20090331")'
runDTS("DTS_Export_MacMillanFeed", dtpStart, dtpEnd) '"20080401", "20090331")'
runDTS("DTS_Export_ImmunologyFeed", dtpStart, dtpEnd) '"20080401", "20090331")'
runDTS("DTS_Export_NeuroPhysiologyFeed", dtpStart, dtpEnd) '"20080401", "20090331")'
Archive(sFileSource, sFileDest)
context.Leave()
Console.WriteLine("Current user: " & WindowsIdentity.GetCurrent().Name)
 
 
EndSub
EndModule
I have difficulty understanding the ins and outs of .net security, so no, I'm not sure about the security issue - can you point me to any guides that are sufficiently un-techie? Most that I have googled don't seem to apply.

If not could you give me an idea of search terms to achieve the best results?

Thanks for your reply.
__________________
Rob Carter