Access - Attachmate Location
Access - Attachmate Location
(OP)
I have a basic Access/Attachmate question. How does Access know where to find the Attachmate Session?
I had a "super-user" who created some screen scrape forms in Access. After he left us the IT folks put a new image on our PCs.
In the old image our mainframe session was here: C:\Program Files\Attachmate\EXTRA!\Sessions
Now its here: C:\Program Files (x86)\Attachmate\EXTRA!\Sessions
Access is still trying to find the session at the old location. I cannot find anywhere in the code where we tell Access to look in "Program Files (x86)" instead of "Program Files". We patched it by recreating the "Program Files" folder and copying the session over there, but it's driving me crazy that I can't find it in the code anywhere.
I had a "super-user" who created some screen scrape forms in Access. After he left us the IT folks put a new image on our PCs.
In the old image our mainframe session was here: C:\Program Files\Attachmate\EXTRA!\Sessions
Now its here: C:\Program Files (x86)\Attachmate\EXTRA!\Sessions
Access is still trying to find the session at the old location. I cannot find anywhere in the code where we tell Access to look in "Program Files (x86)" instead of "Program Files". We patched it by recreating the "Program Files" folder and copying the session over there, but it's driving me crazy that I can't find it in the code anywhere.
RE: Access - Attachmate Location
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: Access - Attachmate Location
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: Access - Attachmate Location
Thanks,
Helen
Option Compare Database
Option Explicit
Private Sub Command4_Click()
'Declare variables
Dim dbsCurrent As DAO.DATABASE
Dim rstReviews As DAO.Recordset
Dim g_HostSettleTime%
Dim Sessions As Object
Dim System As Object
Dim SessName As String
Dim rstEdits As DAO.Recordset
Set dbsCurrent = CurrentDb()
'OpenRecordset method is the basic method of creating a
'Recordset Object. dbOpenTable is the type of Recordset to create. dbOpenDynaset is used for queries
Set rstReviews = dbsCurrent.OpenRecordset("test_table", DB_OPEN_DYNASET)
'With the information from the table acquired, now go to host session
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System Is Nothing) Then
MsgBox "Could not create the EXTRA System object. Stopping macro playback."
Stop
End If
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then
MsgBox "Could not create the Sessions collection object. Stopping macro playback."
Stop
End If
' Set the default wait timeout value
g_HostSettleTime% = 0 ' milliseconds
Dim OldSystemTimeout
OldSystemTimeout = System.TimeoutValue
If (g_HostSettleTime% > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime%
End If
' Get the necessary Session Object
' This is an example of requiring a connection to a specific host session
Dim Sess0 As Object
Dim SessName0
SessName0 = "DSD Mainframe.edp"
On Error Resume Next ' In Case session next statement fails.
Err = 0
Set Sess0 = Sessions.Item(SessName0)
If Err Then
Err = MsgBox(SessName0 + " is not currently open. Open it?", 1)
If 1 = Err Then
Err = 0
Set Sess0 = Sessions.Open(SessName0)
If Err Then
MsgBox ("Failed to open " + SessName0 + ". Stopping playback")
Stop
End If
ElseIf 2 = Err Then
Stop
Else
MsgBox ("Failed to open " + SessName0 + ". Stopping playback")
Stop
End If
End If
'If you just wanted to connect to an active session on the desktop, instead
'of the above lines of code you could use
'Set Sess0 = System.ActiveSession
'make sure the session is visible
If Not Sess0.Visible Then Sess0.Visible = True
Sess0.Screen.WaitHostQuiet (g_HostSettleTime%)
RE: Access - Attachmate Location
CODE
Skip,
Just traded in my OLD subtlety...
for a NUance!
RE: Access - Attachmate Location
RE: Access - Attachmate Location
https://msdn.microsoft.com/en-us/library/ka13cy19(...
Skip,
Just traded in my OLD subtlety...
for a NUance!