list-datasources.mac 929 B

123456789101112131415161718192021222324252627282930313233343536
  1. Dim objApp As Object
  2. Dim objModel As Object
  3. Dim objDataSource As Object
  4. Dim filename as String
  5. Dim folder as String
  6. Dim publish As String
  7. Sub Main ()
  8. Rem On Error Resume Next
  9. folder = "C:\GAPS\Portal\System\Models"
  10. rem filename = "fin_belege.pyi"
  11. rem publish = "C:\GAPS\Portal\System\Cube_out\temp"
  12. rem folder = GetField(Command, 1, ",")
  13. filename = GetField(Command, 1, ",")
  14. rem publish = GetField(Command, 3, ",")
  15. Set objApp = CreateObject("CognosTransformer.Application")
  16. Set objModel = objApp.OpenModel(folder + "\" + filename)
  17. For i = 1 to objModel.DataSources.Count
  18. Set objDataSource = objModel.DataSources.Item(i)
  19. Print objDataSource.Name
  20. Print objDataSource.LocalPath
  21. If objDataSource.SourceType = 4 Then
  22. Print objDataSource.SQLExpression
  23. End If
  24. Print "--"
  25. Next
  26. objModel.Close
  27. objApp.Quit
  28. End Sub