Click or drag to resize

IFindAllMatches Method

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
Syntax
Object AllMatches(
	string Table,
	string ResultField,
	string SearchField,
	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: Object
Array – array of variants
Examples

AllMatches

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

VB
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