Hi,
I have written a function which allows me to enable an existing but closed connection to a palo server.
Display All
The trick is very simple. Jedox saves all informations about server connections in registry. You can manipulate every entry such as "connected". Afterwards you have to force palo to requery registry. This should do the the method ForeceServerListUpdate. But in some cases palo doesn't recongnize the changes. A Palo.Data formula ends in an error and modeller doesn't show the entry.
Has anybody else notice such a behavior?
Regards
Andreas
P.S.: As a christmas gift I provide you my whole VBA module with other usefull functions about palo connections
I have written a function which allows me to enable an existing but closed connection to a palo server.
Source Code
- Private Function ConnectToPaloServer(server As String) As Boolean
- Dim retval As Variant
- Dim connectionStatus As Variant
- Dim connectionInfo As Variant
- Dim nextTry As Boolean
- Dim success As Boolean
- Dim obj As Jedox_Palo_XlAddin.IPaloEngineCom
- Set obj = New Jedox_Palo_XlAddin.ComInterface
- On Error GoTo ConnectToPaloServer_Error
- 'ggf. Verbindung auf "online" stellen
- retval = RegValueGet(HKEY_CURRENT_USER, RegKey & server & "\", "connected", connectionStatus)
- If connectionStatus <> "true" Then _
- retval = RegValueSet(HKEY_CURRENT_USER, RegKey & server & "\", "connected", "true")
- obj.ForceServerListUpdate
- On Error Resume Next
- Do
- success = False
- nextTry = False
- connectionInfo = obj.GetConnectionDataInfo(server)
- Select Case Err.Number
- Case 0:
- If connectionInfo(0) = "" Then
- success = True
- nextTry = False
- Else
- retval = MsgBox(connectionInfo(0), vbAbortRetryIgnore)
- nextTry = (retval = vbRetry)
- End If
- Case Else:
- retval = MsgBox("Anmeldung am Palo Server fehlgeschlagen.", vbAbortRetryIgnore)
- nextTry = (retval = vbRetry)
- End Select
- Err.Clear
- Loop While nextTry
- ConnectToPaloServer = success
- On Error GoTo 0
- Exit Function
- ConnectToPaloServer_Error:
- Debug.Print "Error " & Err.Number & " (" & Err.Description & ") in procedure ConnectToPaloServer of Modul PaloServerRegistration"
- ConnectToPaloServer = False
- End Function
The trick is very simple. Jedox saves all informations about server connections in registry. You can manipulate every entry such as "connected". Afterwards you have to force palo to requery registry. This should do the the method ForeceServerListUpdate. But in some cases palo doesn't recongnize the changes. A Palo.Data formula ends in an error and modeller doesn't show the entry.
Has anybody else notice such a behavior?
Regards
Andreas
P.S.: As a christmas gift I provide you my whole VBA module with other usefull functions about palo connections
