Developer Reference : Data Access Methods : ActiveX Controls Guide : ActiveX Event Reference
 
ActiveX Event Reference
The following topics cover ActiveX events:
CommError
Logon
OnRemote
Reposition
Validate
CommError
Applies to
VAccess control
Description
(DEPRECATED - former I*net Data Server only.) This event fires whenever an IDS communication error is encountered. It will not fire unless the control is attempting to communicate with an IDS.
Syntax
Sub VAccess_CommError (ByVal bCanRecover As Boolean, ByVal wsaeErrCode As Integer, ByVal errorString As String, bReTry As Boolean)
Remarks
The CommError event should be used extensively. Although every possible error does not need special handling, it is important to long-term client satisfaction that the end-user is presented with a screen explaining the error as it pertains to the application, and the steps that should be taken within the application for resolving the error.
CommError has four parameters, one of which may be set by the user. The first parameter, bCanRecover, is Boolean and represents whether or not the error may be recoverable. The second parameter, wsaeErrCode, contains the WinSock error code for the error involved. The third parameter, errorString, contains a description of the error. Finally, the fourth parameter, bReTry, can be set by the application to represent whether or not the client should attempt to re-establish communication with the server. If the first parameter, bCanRecover, is False, setting bReTry will have no effect.
Logon
Applies to
VAccess control
Description
(DEPRECATED - former I*net Data Server only.) This event permits custom handling of the server logon process. It will not be fired unless the control is logging onto a secured IDS server and AutoLogon is set to False.
Syntax
Sub VAccess_Logon(user As String, password As String, database_set As String)
Remarks
This event fires only if the AutoLogon property is set to False. The event has three string parameters that the application must set: user, password, and database_set. When the Logon event is fired and the information given does not result in a successful Logon, the VAccess control will fire the CommError event with the CanRecover parameter set to True. If you attempt another logon, set the Retry parameter to True. This causes the ActiveX to fire the Logon event once again.
As a result, if AutoLogon is False, the handler for this event should provide an escape mechanism or an infinite loop may result.
OnRemote
Applies to
VAccess control
Description
(DEPRECATED - former I*net Data Server only.) This event is fired whenever the VAccess is unable to connect locally to a data file or data dictionary.
Syntax
Sub VAccess_OnRemote(byref goRemote As Boolean, byref newLocation As String)
Remarks
This event fires before an ActiveX control tries to connect with an IDS server or if the given path could not be resolved to a local location. The event has two parameters—a boolean goRemote and a string newLocation. The goRemote boolean indicates whether ActiveX will try to connect to IDS server. This can happen when either DDFPath or Location properties have been resolved to be remote addresses. Such resolutions will occur if either of DDFPath or Location satisfy one of the following criteria (depending on whether goRemote is True or False):
in cases when goRemote = True
Server name given is not present on the local network and a mapping was found in IDSHOSTS file.
Drive specified is not mapped by the operating system and is mapped in IDSHOSTS file.
Location is specified using pids protocol.
Location is specified using Internet server protocol or IP notation.
HostAddress is specified.
in cases when goRemote = FALSE
Server name given is not present on the local network and is not mapped in IDSHOSTS.
Drive specified is not mapped by the operating system and is not mapped in IDSHOSTS file.
newLocation will contain the resolved path. If the location specified in DdfPath or Location is resolved using IDSHOSTS file newLocation will contain the full path. Both newLocation and goRemote are passed by reference so that the user can change the path or tell ActiveX to go ahead or cancel with its attempts to connect to IDS server.
Note ActiveX will not try to connect locally even if newLocation is changed to a local path.
See Also
DdfPath, Location
Reposition
Applies to
VAccess control
Description
The Reposition event fires after a record operation changes the current record referenced by the VAccess control. This event notifies the program that the current record associated with the VAccess control has changed. This event fires after the new record becomes the current record.
Syntax
Sub VAccess_Reposition([Index As Integer])
Validate
Applies to
VAccess control
Description
This event fires before any record operation takes place on the associated Zen file.
Syntax
Sub VAccess_Validate([Index As Integer,]OpCode As Integer, InsertRecord As Integer, UpdateRecord As Integer)
 
Remarks
OpCode corresponds to the Zen API Operation code which is to be performed. Setting this code to another operation code changes the operation performed. Setting this code to zero cancels the operation. Setting either InsertRec or UpdateRec to True inserts or updates the current record, respectively, before executing the operation specified by OpCode. You should not make any calls to the Btrv function using the associated VAccess control, or set any record operation properties of the VAccess control in response to this event, as doing so could result in an infinite loop or have other unpredictable consequences.