PdcDBQuery.SetParamStr

From External Bemet Wiki
Revision as of 13:48, 12 May 2020 by TC (talk | contribs)
Jump to navigation Jump to search

Declaration

SetParamStr(ParameterName as string, Value as string) as boolean

Description

Changes the value of the parameter with a specific name to 'Value'.

Notes

Changes the value of the parameter with a specific name to 'Value'. The result returns it was succesfull or not.

Code example

This code example executes a SQL statement with parameters.

    Dim myQuery As PDCEXT.IDBQuery = PDC.App.Database.OpenQuery(PDCEXT.pdcConnectionKind.pdcConData)
    myQuery.SQL = "SELECT * FROM LK_KLANT WHERE KL_PLAATS=:ParamOne AND KL_VINK1=:ParamTwo"
    myQuery.SetParamStr("ParamOne", "Amsterdam")
    myQuery.SetParamBool("ParamTwo", True)

    If myQuery.Execute Then
      MsgBox(myQuery.GetField("KL_NAAM"))
    Else
      MsgBox($"Error: {PDC.App.LastError}")
    End If

Availability

Available since May 2019 (from version 5.5)