- The actual SQL Statement.
- The IDFieldIndex. (Number sequence starts at zero)
Public Sub CreateStaticQueryviaSQL()
Dim oStaticQuery As CStaticQ
Set oStaticQuery = New CStaticQ
.CreateWithoutPrompt (SEARCH_CONSTITUENT), "Custom", "Test", _
, , , , , True 'The Last true overwrites queries with the same name
.AddviaSQLStmt "SELECT RECORDS.ID FROM dbo.RECORDS WHERE RECORDS.LAST_NAME = 'Smith'", 0
Set oStaticQuery = Nothing
In the above example there is one select field i.e. the id field so the "IDFieldIndex" that corresponds to it is 0. If the id field were the third field in the SQL statement, the IDFieldIndex would be 2.
Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Blackbaud Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.