Performing a network recovery – Echelon LNS User Manual
Page 274
LNS Programmer's Guide
260
Performing a Network Recovery
To recover a network database, you can use the LNS Database Recovery Wizard. The
wizard takes your preferences on several guided pages, runs and controls the recovery
process, and formats the resulting database by evaluating device resource files, device
interface files, and device interface data. You can access the LNS Database Recovery
Wizard by selecting Start>Programs>Echelon LNS Utilities>LNS Database
Recovery Wizard.
To recover a network database with your own LNS application, follow these steps:
1. Create a new Network object using the Add() method for the Networks collection.
Dim RecoveredNet as LcaNetwork
Set RecoveredNet = MyNetworks.Add("Recvrd","c:\DB", True)
2.
Open the new network.
RecoveredNet.Open()
3.
Open the system, and set the NetworkInterface object contained in the System
object’s NetworkServiceDevice object to identify the network interface for the new
network.
Set RecoveredSystems = RecoveredNetwork.Systems
Set RecoveredSystem = RecoveredSystems.Item(1)
Set RecoveredNSD = RecoveredSystem.NetworkServiceDevice
Set RecoveredNSD.NetworkInterface = SelectedNI
4.
Call the System object’s PrepareToRecoverFromNetwork() method. If objects
have been added to the Network object created in step 1, an exception will be
thrown. Set the recoverNetInterface parameter to True if you want the domain
signature and authentication key to be recovered from the network interface. Note
that this option is only valid when the network interface is a standard network
interface whose configuration is consistent with the network. If this parameter is set
to False, LNS will read the domain signature from the System object’s DomainId
property. In this case, you should make sure the DomainId property is set to a valid
value.
RecoveredSystem.DomainId = “32a0cf”
RecoveredSystem.PrepareToRecoverFromNetwork(False)
5.
Open the system.
RecoveredSystem.Open()
6. If
the
recoverNetworkInterface option was set to False and network
authentication is being used on the network being recovered, set the System object’s
AuthenticationKey property.