Visual Basic Example

This document provides examples on how to create a Visual Basic object with the DCOM Wrapper and how to use the properties of this object.

Define an Object :

Dim OLEObj as Object

Create an Object :

Set OLEObj = CreateObject("<Object Name>")

Retrieve User ID :

Dim sUserID As String
sUserID = OLEObj.UserID

Retrieve RPC User ID :

Dim sRpcUserID As String
sRpcUserID = OLEObj.RpcUserID

Retrieve Timeout Value :

Dim lTimeOut As Integer
lTimeOut = OLEObj.TimeOut

Retrieve and display Server Address :

MsgBox "Server Address : " & OLEObj.ServerAddress

Retrieve Token :

Dim sToken As String
sToken = OLEObj.Token

Retrieve Library :

Dim sLibrary As String
sLibrary = OLEObj.Library

Retrieve Compression :

Dim sCompression As String
sCompression = OLEObj.Compression

Retrieve Natural Logon :

Dim sNaturalLogon As String
sNaturalLogon = OLEObj.NaturalLogon

Retrieve Error Class :

Dim sErrorClass As Long
sErrorClass = OLEObj.ErrorClass

Retrieve Error Number :

Dim sErrorNumber As Long
sErrorNumber = OLEObj.ErrorNumber

Retrieve Error Message :

Dim sErrorMessage As String
sErrorMessage = OLEObj.ErrorMessage

Display Error Message :

Use the Description property of Visual Basic's Error object, for example:

On Error GoTo frmload_ErrProc
...
frmload_ErrProc:
MsgBox Err.Description, Err.Source

Set User ID :

OLEObj.UserID = "<User ID>"

Set Password :

OLEObj.Password = "<Password>"

Set NewPassword :

OLEObj.NewPassword = "<NewPassword>"

Set RPC User ID :

OLEObj.RpcUserID = "<RpcUser ID>"

Set RPC Password :

OLEObj.RpcPassword = "<RpcPassword>"

Set Server Address :

OLEObj.ServerAddress = "<Server Address>"

Set Time Out Value :

OLEObj.TimeOut = <Timeout value>

Set Token :

OLEObj.Token = "<Token>"

Set Library :

OLEObj.Library = "<Library Name>"

Set Compression :

OLEObj.Compression = "<Compression Type>"
<Compression Type> ::= '<blank>' | '2'

Set Natural Logon :

OLEObj.NaturalLogon = "<Natural Logon>"
<Natural Logon> ::= 'Y' | 'N'

Open Conversation :

OLEObj.OpenConversation

Close Conversation with Backout:

OLEObj.CloseConversation

Close Conversation with Commit :

OLEObj.CloseConversationCommit

Broker Logon :

OLEObj.Logon

Broker Logoff :

OLEObj.Logoff

Setting up User ID and Timeout Value using Method SetInfo:

OLEObj.SetInfo UserID:=tbUserID.Text, TimeOut:=30

Similarly, other named parameters can be used for setting connection and user-specific information. Other named parameters are as follows :

Named Parameter Purpose More Information
UserID The user ID for access to the broker. Using the Broker and RPC User ID/Password
Password The password for secured access to the broker.
NewPassword For changing the password to a new password.  
Token Sets Token, maximum 32 characters long.  
BrokerID Sets Broker ID, maximum 32 characters long.  
ServerName Sets Server Name, maximum 32 characters long.  
ServerClass Sets Server Class, maximum 32 characters long.  
ServiceName Sets Service Name, maximum 32 characters long.  
TimeOut Sets Timeout value, timeout value is validated at server end. Cannot be less than or equal to 0.  
RpcUserID The RPC user ID sent to the RPC server. Using the Broker and RPC User ID/Password
RpcPassword The RPC password sent to the RPC server.
ForceLogon Determines whether explicit or auto-logon is used by the caller.  
SSLString Used for setting SSL parameters. SSL/TLS and Certificates with EntireX in the Platform-independent Administration documentation
CompressLevel Compression level. Valid values: N/Y/0-9.

Only the first character of the string will be used for the compression. If you type YES, the character Y will be used and ES will be cut off.

Data Compression in EntireX Broker