Guest User

Untitled

a guest
Jan 17th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.24 KB | None | 0 0
  1. '#Language "WWB-COM"
  2. 'Scroll down to view the rest of the code
  3.  
  4. Option Explicit
  5. Option Base 1
  6.  
  7. Sub Main
  8. Const sCommon As String = "\uk1dsntv003RD-MDD-STATSCIStatSciEuropeSystemsMagicianCode"
  9.  
  10. Dim sCode As String
  11. sCode = "'#Reference {C9E29002-3D45-11D4-9FF4-00C04FA0D540}#1.0#0#C:Program FilesStatSoftSTATISTICA 12sta_bas.dll#STATISTICA Basic Statistics Library#STABasicStatistics"
  12. sCode += vbCrLf & "'#Language ""WWB-COM""" & vbCrLf & "Option Explicit" & vbCrLf & "Option Base 1"
  13.  
  14. sCode += vbCrLf & "Const sMagicianVersion As String = ""MAGICIAN """ 'The current system version
  15. sCode += vbCrLf & "Const sMagicianError As String = sMagicianVersion & "" - ERROR""" 'Title for message boxes containing errors
  16. sCode += vbCrLf & "Const sMagicianType As String = ""Validation""" 'The type of installation e.g. Validation, Production
  17.  
  18. 'UK production database
  19. 'sCode += vbCrLf & "Const sProvantisDataSource As String = ""p_pu""" 'The data source name to connect to Provantis
  20. 'sCode += vbCrLf & "Const sProvantisPassword As String = ""p_e_pq""" 'The password to connect to Provantis
  21. 'sCode += vbCrLf & "Const sProvantisUserId As String = ""p_e_pqs""" 'The user id to connect to Provantis
  22.  
  23. 'UK validation database
  24. 'sCode += vbCrLf & "Const sProvantisDataSource As String = ""p_vu""" 'The data source name to connect to Provantis
  25. 'sCode += vbCrLf & "Const sProvantisPassword As String = ""p_e_vq""" 'The password to connect to Provantis
  26. 'sCode += vbCrLf & "Const sProvantisUserId As String = ""p_e_vqs""" 'The user id to connect to Provantis
  27.  
  28. 'UM validation database
  29. sCode += vbCrLf & "Const sProvantisDataSource As String = ""p_vk""" 'The data source name to connect to Provantis
  30. sCode += vbCrLf & "Const sProvantisPassword As String = ""p_e_vrs""" 'The password to connect to Provantis
  31. sCode += vbCrLf & "Const sProvantisUserId As String = ""p_e_vrq""" 'The user id to connect to Provantis
  32.  
  33. sCode += vbCrLf & "Const sConnectProvantis As String = ""Provider=OraOLEDB.Oracle;Persist Security Info=True;"" & " & _
  34. """Data Source="" & sProvantisDataSource & "";User Id="" & sProvantisUserId & " & _
  35. """;Password="" & sProvantisPassword & "";""" 'The connection string for the Provantis database
  36.  
  37. Dim sMacro As Macro
  38. Set sMacro = Macros.Open(sCommon & "Magician.svb")
  39. Dim sMacroCopy As New Macro
  40. sMacroCopy.Text = "" 'this line prevents an access violation error
  41. sMacroCopy.Text = sCode & vbCrLf & sMacro.Text
  42. sMacroCopy.Scripting = 0
  43. sMacroCopy.Execute
  44. sMacro.Close
  45. sMacroCopy.Close
  46. End Sub
  47.  
  48. Sub Main
  49. On Error GoTo ProgramEnd
  50.  
  51. 'Display a message to the user while Magician is starting up.
  52. 'The Setup subroutine will be called from the DlgStartUp function.
  53. Begin Dialog UserDialog 450,126,sMagicianVersion & " - [Starting up]",.DlgStartUp ' %GRID:10,7,1,1
  54. Text 70,49,310,14,"Magician is starting up, please wait...",.lblWaitMsg,2
  55. OKButton 180,77,90,28,.cmdOK
  56. End Dialog
  57. Dim DlgStartUp As UserDialog
  58. Dialog DlgStartUp
  59.  
  60. 'Call the StudyUI subroutine to prompt the user to enter a study number.
  61. 'Once the study number has been validated, MeasurementsUI will be called from the DlgStudy function.
  62. 'Once the measurements have been validated, GroupsUI will be called from the DlgMeas function.
  63. 'Once the groups have been validated, the three dialogs will close and StudyUI will end.
  64. Call StudyUI
  65.  
  66. 'Display a message informing the user that Magician has started its analysis.
  67. 'The GetAllMeasurements, AnalyseAll and PrintAll subroutines will be called from the DlgAnalyseReport function.
  68. Begin Dialog UserDialog 450,126,sMagicianVersion & " - [Analysing/reporting data]",.DlgAnalyseReport ' %GRID:10,7,1,1
  69. Text 70,35,310,14,"Magician is analysing the data, please wait...",.lblWaitMsg,2
  70. OKButton 180,77,90,28,.cmdOK
  71. End Dialog
  72. Dim DlgAnalyseReport As UserDialog
  73. Dialog DlgAnalyseReport
  74.  
  75. ProgramEnd:
  76. If Err.Number <> 0 Then
  77. MsgBox "An SVB exception has occurred: please contact the Statistical Computing Team, email RD SCT-Mailstore-DB" _
  78. & vbCrLf & "Err.Description: " & Err.Description, , sMagicianVersion
  79. End If
  80. Call ExitProgram
  81.  
  82. End Sub 'Main
Add Comment
Please, Sign In to add comment