User:Kate Racaza/test page
Jump to navigation
Jump to search
DRAFT
VBA versions of the new tutorials.
Upload XML File to XFRACAS
VBA Sub Main() 'Connect to the Synthesis enterprise repository. Dim MyRepository As New Repository Call MyRepository.ConnectToSQLRepository("ServerName", "DatabaseName") 'Replace with values for test repository. 'Get a list of all available XFRACAS entities. Dim ListOfEntities() As NameIdPair ListOfEntities = MyRepository.XFRACAS.GetAllXfracasEntities 'Select an XFRACAS entity. This example gets the first available entity in the array. Dim EntityID As Integer EntityID = ListOfEntities(0).ID 'Upload the XML file to the import queue of the XFRACAS entity. This code assumes that an XML file 'called XMLData.xml contains XFRACAS incidents and is saved in the C drive. Dim j As Integer j = MyRepository.XFRACAS.ImportXfracasXmlFile(EntityID, XFRACASImportType_Incident, "C:\XMLData.xml", "My new data") End Sub