Forum Discussion

M_L_Spencer's avatar
M_L_Spencer
New Contributor II
3 months ago

External Connection for OS App in Same Environment?

Hi there everyone,

Anyone ever created a connection between apps in the same OS environment? Working on some data movement and I have the connector set up, but struggling a bit with the connection string for the external database connection I'm setting up to reference the app I'm pulling data from. Is it the same syntax as the BI Blend connection, or are there other keywords that need to be in there?

Thanks!

1 Reply

  • JennyC's avatar
    JennyC
    New Contributor III

    Hi,

    If it is in the same environment, you can connect to another app using the below method.

    I was able to read and import.

    Dim oar As New OpenAppResult

    Dim osi As SessionInfo = BRApi.Security.Authorization.CreateSessionInfoForAnotherApp(siSource, appName, openAppResult)

    If oar = OpenAppResult.Success Then

    Dim SourceSQL As String = $"Select SQL"
     
    Dim SourceTable As New DataTable
    Using dbconn As DbConnInfoApp = BRApi.Database.CreateApplicationDbConnInfo(osi)
    SourceTable = BRApi.Database.ExecuteSql(dbconn, SourceSQL, True)
     
    If SourceTable.Rows.Count > 0 Then
    api.Parser.ProcessDataTable(Osi, SourceTable, False, api.ProcessInfo)
    End If
     
    End Using

     

    End If
    osi.CloseApplication
     
    Thanks,
    Jenny