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.
Dim OLEObj as Object
Set OLEObj = CreateObject("<Object Name>")
Dim sUserID As String
sUserID = OLEObj.UserID
Dim sRpcUserID As String
sRpcUserID = OLEObj.RpcUserID
Dim lTimeOut As Integer
lTimeOut = OLEObj.TimeOut
MsgBox "Server Address : " & OLEObj.ServerAddress
Dim sToken As String
sToken = OLEObj.Token
Dim sLibrary As String
sLibrary = OLEObj.Library
Dim sCompression As String
sCompression =
OLEObj.Compression
Dim sNaturalLogon As String
sNaturalLogon =
OLEObj.NaturalLogon
Dim sErrorClass As Long
sErrorClass =
OLEObj.ErrorClass
Dim sErrorNumber As Long
sErrorNumber =
OLEObj.ErrorNumber
Dim sErrorMessage As String
sErrorMessage =
OLEObj.ErrorMessage
Use the Description property of Visual Basic's Error object, for example:
On Error GoTo frmload_ErrProc
...
frmload_ErrProc:
MsgBox Err.Description, Err.Source
OLEObj.UserID = "<User ID>"
OLEObj.Password = "<Password>"
OLEObj.NewPassword = "<NewPassword>"
OLEObj.RpcUserID = "<RpcUser ID>"
OLEObj.RpcPassword = "<RpcPassword>"
OLEObj.ServerAddress = "<Server Address>"
OLEObj.TimeOut = <Timeout value>
OLEObj.Token = "<Token>"
OLEObj.Library = "<Library Name>"
OLEObj.Compression = "<Compression Type>"
<Compression
Type> ::= '<blank>' | '2'
OLEObj.NaturalLogon = "<Natural Logon>"
<Natural
Logon> ::= 'Y' | 'N'
OLEObj.OpenConversation
OLEObj.CloseConversation
OLEObj.CloseConversationCommit
OLEObj.Logon
OLEObj.Logoff
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 |
---|---|
UserID | Sets User ID, maximum 32 characters long. |
Password | Sets Password, maximum 32 characters long. |
NewPassword | Sets NewPassword, maximum 32 characters long. |
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 Timout value, timeout value is validated at server end. Cannot be less than or equal to 0. |
RpcUserID | Sets RPC User ID, maximum 32 characters long. |
RpcPassword | Sets RPC Password, maximum 32 characters long. |
ForceLogon | Determines whether explicit or auto-logon is used by the caller. |
EncryptionLevel | Encryption level used by EntireX Security. |
SSLString | Used for setting SSL parameters. |
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. See also Data Compression in EntireX Broker. |