hi,

i have several Access 2003 databases set up to run automated processes on terminal 3270 clients.

trouble being that the terminal sometimes falls over, and when i try to call my 'Login_Script' i get an error:

"the remote server machine does not exist or is unavailable"

i need to close the database and re-open it for it to work, but this is not always a viable option given that it loops through records of about 30k. i have worked around this by adding a complete flag to each record so i know if it has finished that particular iteration or not, and can be restarted from the first record which isnt complete, but I would like to know if i could code around this in some way.

the code looks like this:

Code:
Option Compare Database
Option Explicit

'global to allow debugging of user ID
Public strPassword As String
Public strUser As String

'session variables
Public MyDefaultsystem As New HostExSystem
Public MyDefaultsession As New HostExSession
Public myDefaultScreen As New HostExScreen

Public Function LoginScript()
' breakpoint check for debugging
If BreakPoints = "Yes" Then
    Stop
End If

    'open session and set options
    Set MyDefaultsession = MyDefaultsystem.Sessions.Open(Session_Path & Session_Name)
    MyDefaultsession.Visible = True
    MyDefaultsystem.TimeoutValue = 50
    Set myDefaultScreen = MyDefaultsession.Screen

blah blah

End Function
so i call login script, run additional functions to utilise the 3270 session, but half way through an action it falls over, the session closes down and the code debugs.

if i debug and call login script to get the session started again, i get the above error.
this is not something that happens consistently, as sometimes calling login script after a crash works fine.

do i need to do something to re-assign the global session variables?

TIA