|
I'm going to review some things you already know for the benefit of other readers.
You have scheduled agents from LEI 3 that contain the statement Uselsx "*lsxlei". With 6.0 and later, the lsxlei library is not available, and you must change these to Uselsx "*lsxlc".
The lsxlc library contains the same functionality as the old lsxlei; they have been merged in LEI 6. However, some functionality is only available when your agent is run by a "scripted activity." Specifically, scripted activities can write to the LEI log and can initialize an LCConnection with data from an LEI "connection" document (so that you do not need to hardcode the database name, userID, password and other details). Scheduled agents and other code not executed by an LEI scripted activity may not use these functions. For example, in a scripted activity you could write:
Dim lcses As New LCSession
("Name you make up")
Dim lccon As New LCConnection
("LEI connection document")
(where LEI connection document is the name you selected for a connection document in the LEI database. Since the connection document contains the database name, userID and password, you don't need any other information to connect to the database. However, when not in a scripted activity, you cannot use a connection document; instead you must use the name of a connector such as "db2." So in your scheduled agent you might write:
Dim lcses As New LCSession
Dim lccon As New LCConnection
("db2") ' or other connector name...
lccon.Database = "CUSTTRAK"
lccon.Userid = "Miguel"
lccon.Password = "hola!"
Since your problem involves scheduled agents, you can solve the problem quite easily. Disable the agents' schedules, and use the LEI Administration console to create Scripted Activities that run the agents on schedule instead. Then your existing code should work exactly "as is."
If you don't want to use scripted activities to run the agents, LEI version 6.5.1 supports initializing connections either from a connection document, or with a connector even when you are not in a scripted activity. If you can upgrade to 6.5.1, you don't need to hardcode connection information; however, logging functions are still only available if you're running a scripted activity.
If upgrading is not an option, go to the LEI Redbook online and click the "Additional Material" link. The downloadable sample database that accompanies the Redbook contains a script library names DECSDatabase, which you can use to initialize a connection from a connection document.
By the way, since you describe these as "replication" agents, have you considered trying to replace them entirely with LEI Replication activities? That'll probably run faster than your script since it's implemented in C.
Do you have comments on this Ask the Expert Q&A? Let us know.
|