My Oracle Support Banner

SetSearchExpr throws 'Type Mismatch' error when using SiebelDataServer COM object in Siebel 7.8.2.5-ARCHIVE (Doc ID 517555.1)

Last updated on JANUARY 02, 2020

Applies to:

Siebel Tools - Version 7.7.2 [18325] and later
Information in this document applies to any platform.
Version: 7.7.2 [18325]

Database: IBM DB2 6

Application Server OS: None - Not Implementing Web Server OS

Database Server OS: None - Not Implementing Web Server OS



This document was previously published as Siebel SR 38-3442118767.

Symptoms

When using the SetSearchSpec business component method using the SiebelDataServer COM object, the method errors out with 'Type Mismatch' error. I've ran the below code successfully using 7.8.2 but it fails in 7.8.2.5.

Dim errCode As Integer
Dim app As SiebelApplication
Dim bo As SiebelBusObject
Dim bc As SiebelBusComp

Set app = CreateObject("SiebelDataServer.ApplicationObject")

app.LoadObjects "C:\Program Files\Siebel\7.8\web client\BIN\ENU\SFX_Demo.cfg", errCode

If errCode <> 0 Then MsgBox errCode & vbCrLf & app.GetLastErrText

app.Login "sporter", "sporter", errCode

If errCode <> 0 Then
    MsgBox errCode & vbCrLf & app.GetLastErrText Else
    MsgBox "Login succeeded."
    
    Set bo = app.GetBusObject("Contact", errCode)
    If errCode <> 0 Then
        MsgBox errCode & vbCrLf & app.GetLastErrText
    Else
        Set bc = bo.GetBusComp("Contact", errCode)
        If errCode <> 0 Then
            MsgBox errCode & vbCrLf & app.GetLastErrText
        Else
            bc.SetViewMode 3, errCode
            bc.ClearToQuery errCode
            bc.SetSearchExpr "[Last Name] = ""LastName""", errCode
            bc.ExecuteQuery True, errCode
            
            MsgBox bc.FirstRecord(errCode)
            
            If bc.FirstRecord(errCode) = True Then
            
               MsgBox bc.GetFieldValue("First Name", errCode)
            
            End If
        End If
    End If
End If

Set bc = Nothing
Set bo = Nothing
Set app = Nothing


Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
 Message 1

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.