Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '#Language "WWB-COM"
- 'Scroll down to view the rest of the code
- Option Explicit
- Option Base 1
- Sub Main
- Const sCommon As String = "\uk1dsntv003RD-MDD-STATSCIStatSciEuropeSystemsMagicianCode"
- Dim sCode As String
- sCode = "'#Reference {C9E29002-3D45-11D4-9FF4-00C04FA0D540}#1.0#0#C:Program FilesStatSoftSTATISTICA 12sta_bas.dll#STATISTICA Basic Statistics Library#STABasicStatistics"
- sCode += vbCrLf & "'#Language ""WWB-COM""" & vbCrLf & "Option Explicit" & vbCrLf & "Option Base 1"
- sCode += vbCrLf & "Const sMagicianVersion As String = ""MAGICIAN """ 'The current system version
- sCode += vbCrLf & "Const sMagicianError As String = sMagicianVersion & "" - ERROR""" 'Title for message boxes containing errors
- sCode += vbCrLf & "Const sMagicianType As String = ""Validation""" 'The type of installation e.g. Validation, Production
- 'UK production database
- 'sCode += vbCrLf & "Const sProvantisDataSource As String = ""p_pu""" 'The data source name to connect to Provantis
- 'sCode += vbCrLf & "Const sProvantisPassword As String = ""p_e_pq""" 'The password to connect to Provantis
- 'sCode += vbCrLf & "Const sProvantisUserId As String = ""p_e_pqs""" 'The user id to connect to Provantis
- 'UK validation database
- 'sCode += vbCrLf & "Const sProvantisDataSource As String = ""p_vu""" 'The data source name to connect to Provantis
- 'sCode += vbCrLf & "Const sProvantisPassword As String = ""p_e_vq""" 'The password to connect to Provantis
- 'sCode += vbCrLf & "Const sProvantisUserId As String = ""p_e_vqs""" 'The user id to connect to Provantis
- 'UM validation database
- sCode += vbCrLf & "Const sProvantisDataSource As String = ""p_vk""" 'The data source name to connect to Provantis
- sCode += vbCrLf & "Const sProvantisPassword As String = ""p_e_vrs""" 'The password to connect to Provantis
- sCode += vbCrLf & "Const sProvantisUserId As String = ""p_e_vrq""" 'The user id to connect to Provantis
- sCode += vbCrLf & "Const sConnectProvantis As String = ""Provider=OraOLEDB.Oracle;Persist Security Info=True;"" & " & _
- """Data Source="" & sProvantisDataSource & "";User Id="" & sProvantisUserId & " & _
- """;Password="" & sProvantisPassword & "";""" 'The connection string for the Provantis database
- Dim sMacro As Macro
- Set sMacro = Macros.Open(sCommon & "Magician.svb")
- Dim sMacroCopy As New Macro
- sMacroCopy.Text = "" 'this line prevents an access violation error
- sMacroCopy.Text = sCode & vbCrLf & sMacro.Text
- sMacroCopy.Scripting = 0
- sMacroCopy.Execute
- sMacro.Close
- sMacroCopy.Close
- End Sub
- Sub Main
- On Error GoTo ProgramEnd
- 'Display a message to the user while Magician is starting up.
- 'The Setup subroutine will be called from the DlgStartUp function.
- Begin Dialog UserDialog 450,126,sMagicianVersion & " - [Starting up]",.DlgStartUp ' %GRID:10,7,1,1
- Text 70,49,310,14,"Magician is starting up, please wait...",.lblWaitMsg,2
- OKButton 180,77,90,28,.cmdOK
- End Dialog
- Dim DlgStartUp As UserDialog
- Dialog DlgStartUp
- 'Call the StudyUI subroutine to prompt the user to enter a study number.
- 'Once the study number has been validated, MeasurementsUI will be called from the DlgStudy function.
- 'Once the measurements have been validated, GroupsUI will be called from the DlgMeas function.
- 'Once the groups have been validated, the three dialogs will close and StudyUI will end.
- Call StudyUI
- 'Display a message informing the user that Magician has started its analysis.
- 'The GetAllMeasurements, AnalyseAll and PrintAll subroutines will be called from the DlgAnalyseReport function.
- Begin Dialog UserDialog 450,126,sMagicianVersion & " - [Analysing/reporting data]",.DlgAnalyseReport ' %GRID:10,7,1,1
- Text 70,35,310,14,"Magician is analysing the data, please wait...",.lblWaitMsg,2
- OKButton 180,77,90,28,.cmdOK
- End Dialog
- Dim DlgAnalyseReport As UserDialog
- Dialog DlgAnalyseReport
- ProgramEnd:
- If Err.Number <> 0 Then
- MsgBox "An SVB exception has occurred: please contact the Statistical Computing Team, email RD SCT-Mailstore-DB" _
- & vbCrLf & "Err.Description: " & Err.Description, , sMagicianVersion
- End If
- Call ExitProgram
- End Sub 'Main
Add Comment
Please, Sign In to add comment