BusinessObjects Board

[Solved][VB6] List of universes

Hi!

Now that I found my SDK :roll:, I would like to get the list of all universes my account has access to.

I tried this :

Dim designerApplication As New Designer.Application
Call designerApplication.Logon("login", "password", "server", "secEnterprise")
Dim nbrUniverses As Integer
For nbrUniverses = 0 To designerApplication.universes.Count - 1
    list.AddItem (designerApplication.universes.Item(nbrUniverses).Name)
    'list is a multiselect listbox
Next

But there are no universe in this list (designerApplication.universes.Count = 0)… :frowning:

I tried other things with a Designer.Universes variable and Imoprt, Add… but it doesn’t work better… :?

Any idea?


AHL :fr: (BOB member since 2008-01-25)

What version of business objects are you on?

Here is a snippet of how we loop through universes via the SDK in XI:



Dim y As Integer
Dim oInfoStore As CrystalInfoStoreLib.InfoStore
Dim oInfoObjects As CrystalInfoStoreLib.InfoObjects
Dim ObjDes As Designer.Application
Dim oSessionMgr As CrystalEnterpriseLib.SessionMgr
Dim oEnterpriseSession As CrystalEnterpriseLib.EnterpriseSession
Dim oInfoObject As CrystalInfoStoreLib.InfoObject
Dim sSQL As String


Set ObjDes = New Designer.Application

ObjDes.Interactive = False

Call ObjDes.Logon(sLoginName, sPassword, sCMS, sAuthenticationMode)


Set oSessionMgr = New CrystalEnterpriseLib.SessionMgr
Set oEnterpriseSession = oSessionMgr.Logon(sLoginName, sPassword, sCMS, sEnterpriseSessionType)
Set oInfoStore = oEnterpriseSession.Service("", "InfoStore")

sSQL = ""
sSQL = "SELECT "
sSQL = sSQL & " SI_NAME,SI_REVISIONNUM,SI_SHORTNAME,SI_UPDATE_TS,SI_PARENT_FOLDER,SI_OWNER,SI_PARENT_FOLDER_CUID "
sSQL = sSQL & " FROM CI_APPOBJECTS "
sSQL = sSQL & " WHERE SI_KIND='Universe' "


Set oInfoObjects = oInfoStore.Query(sSQL)



For y = 1 To oInfoObjects.Count
    Debug.Print oInfoObjects.Item(y).Properties.Item("SI_NAME")

Next y


jresendez :mexico: (BOB member since 2004-05-03)

I’ve got the XI R2 SP3. Sorry about that miss… :oops:

But thanks for the code, I’ll study it carefuly. :slight_smile:


AHL :fr: (BOB member since 2008-01-25)

I wanted to also add; my code utilizes the following references:

Crystal Enterprise Infostore Library 11.5
Crystal Enterprise Framework Library 11.5
BusinessObjects 11.5 Object Library
BusinessObjects Designer 11.5 Object Library


jresendez :mexico: (BOB member since 2004-05-03)

That’s because it’s the local Designer application counting the number of universes IT has open. If you want to look at the repository contents, you need the .StoredUniverses collection.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Yeah, thanks, it works (with my “syntax”) ! :smiley:

That’s what I thought, but I just didn’t know how to go round the problem. :wink:


AHL :fr: (BOB member since 2008-01-25)

Someone can give me a hand :lol:
the core of the problem is maybe not so far of our:

Thanks


gana3000 :fr: (BOB member since 2007-04-19)