Click or drag to resize

IFindFirstMatch 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 the first contact 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 FirstMatch(
	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 variant
Examples

FirstMatch

This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.

VB
dim objso
set objso = CreateObject("superofficedb.database")
If not (objSO is nothing) Then
    objso.login "<USERID>", "<password>"
    searchvalue  = "979%"
    result = objso.find.firstmatch("contact", "contact_id", "orgnr", searchvalue)
    msgbox objso.getcontact(result).name   
else
    msgbox  "could not log in"
end if
set objso = nothing

See Also