How can I print all data sources, which are registered in the DatabaseContext?
/* get the service manager */
xContext = UNO.connect()
XMcf = xContext~getServiceManager
/* create a instance of the DatabaseContext service */
databaseContext = xMcf~createInstanceWithContext(-
"{%see com.sun.star.sdb.DatabaseContext}", xContext)
/* retrieve the XNameAccess interface of the DatabaseContext */
xNameAccess = databaseContext~{%see com.sun.star.container.XNameAccess%XNameAccess}
/* list all datasource names using the the method getElementNames */
DO n OVER xNameAccess~getElementNames
say n
END
say xNameAccess~hasByName("Bibliography") --returns 1 if it exists
say xNameAccess~getByName("Bibliography") --returns the data source
::requires UNO.cls -- get UNO support