find list of field values using another field as the key - poor mans SQL query Example: Find.Field("contact","contact_id","number1", "SUPER") returns an array with the contact ids where CODE = 'SUPER'
Perform a "poor mans" SQL query to find list of field values using another field as the key.
Namespace:
SuperOffice.COM.SuperOfficeDB
Assembly:
SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
SyntaxObject AllMatches(
string Table,
string ResultField,
string SearchField,
Object KeyValue
)
Function AllMatches (
Table As String,
ResultField As String,
SearchField As String,
KeyValue As Object
) As Object
Dim instance As IFind
Dim Table As String
Dim ResultField As String
Dim SearchField As String
Dim KeyValue As Object
Dim returnValue As Object
returnValue = instance.AllMatches(Table,
ResultField, SearchField, KeyValue)
Object^ AllMatches(
[InAttribute] String^ Table,
[InAttribute] String^ ResultField,
[InAttribute] String^ SearchField,
[InAttribute] Object^ KeyValue
)
Parameters
- Table
- Type: SystemString
for example Contact - ResultField
- Type: SystemString
for example Contact_id - SearchField
- Type: SystemString
for example Number1 - KeyValue
- Type: SystemObject
for example SUPER
Return Value
Type:
ObjectArray – array of variants
ExamplesAllMatches
This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.
Search the contact table for all records that has an OrgNr that starts with 979.
Returns a message box with the Contact name for each, and the result count in a message box
Dim objSO
Set objSO = CreateObject("SuperOfficeDB.Database")
If not (objSO is nothing) Then
objSO.login "<USERID>", "<password>"
no = 0
searchsValue = "979%"
result = objSO.find.Allmatches("Contact", "Contact_id", "OrgNr", searchsValue)
for each item in result
set cont = objSO.getContact(item)
msgbox cont.name
no = no + 1
next
msgbox "There were " & no & " records that matched the search criteria"
Else
MsgBox "Could not log in"
End If
Set objSO = Nothing
See Also