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 UserIDThe user ID for access to the broker. Using the Broker and RPC User ID/Password PasswordThe password for secured access to the broker. NewPasswordFor changing the password to a new password. TokenSets Token, maximum 32 characters long. BrokerIDSets Broker ID, maximum 32 characters long. ServerNameSets Server Name, maximum 32 characters long. ServerClassSets Server Class, maximum 32 characters long. ServiceNameSets Service Name, maximum 32 characters long. TimeOutSets Timeout value, timeout value is validated at server end. Cannot be less than or equal to 0. RpcUserIDThe RPC user ID sent to the RPC server. Using the Broker and RPC User ID/Password RpcPasswordThe RPC password sent to the RPC server. ForceLogonDetermines whether explicit or auto-logon is used by the caller. SSLStringUsed for setting SSL parameters. SSL/TLS, HTTP(S), and Certificates with EntireX in the platform-independent Administration documentation CompressLevelCompression 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