PdcDatabase.OpenExternalQuery

From External Bemet Wiki
Revision as of 10:47, 24 February 2020 by Arjan (talk | contribs) (Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Declaration

OpenExternalQuery(ServerIP as String, Port as Integer, DBName as String) as PdcDBQuery

Description

Return a IDBQuery for execution

Notes

This method opens a query for a specified SQL statement to another PdC environment.

Please pay attention! Parameters are case sensitive

Code example

Dim qryRemote As PDCEXT.IDBQuery = PDC.App.Database.OpenExternalQuery("127.0.0.1", 5432, "pdc55")

    If Not IsNothing(qryRemote) Then
      qryRemote.SQL = $"select * from lk_klant where kl_debnr = '000028'"
      If qryRemote.Execute Then
        MsgBox(qryRemote.GetStr("kl_naam"))
      Else
        MsgBox(PDC.App.LastError)
      End If
    End If

Availability

Available from version 5.5