PdcDBQuery.SetParamBool: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "== Declaration == SetParamBool(ParameterName as string, Value as boolean) as boolean == Description == Changes the value of the parameter with a specific name to 'Value'. == ..."
 
No edit summary
Line 5: Line 5:


== Notes ==
== Notes ==
This method will move the record pointer to the previous record in the created query.
Changes the value of the parameter with a specific name to 'Value'.
The result returns it was succesfull or not.
The result returns it was succesfull or not.



Revision as of 15:29, 31 October 2019

Declaration

SetParamBool(ParameterName as string, Value as boolean) 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.

Sub sExecuteQuery
dim objQuery

  set objQuery = pdc.Database.OpenQuery(pdcConData)
  objQuery.SQL = "SELECT * FROM LK_KLANT WHERE KL_PLAATS=:ParamOne AND KL_VINK1=:ParamTwo"
  objQuery.SetParamStr  "ParamOne", "Amsterdam"
  objQuery.SetParamBool "ParamTwo", True
  
  if objQuery.Execute then
    msgbox objQuery.GetField("KL_NAAM")
  else
    msgbox "Error:" & vbCrLf & pdc.LastError & vbCrLf & vbCrLf & "SQL:" & vbCrLf & objQuery.SQL
  end if
End Sub

Availability

Available since May 2019 (from version 5.5)