INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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.

RE: Access - Attachmate Location

Plz post the code that Sets the System and Session objects. Use Edit/Find on the entire project.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Access - Attachmate Location

(OP)
Here is the part of the code that connects to the mainframe. Everything after this has to do with our unique process (specific fields to scrape, what table to use, etc...)

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

This is my code for assigning the Session object in Attachmate Extra...

CODE

'
    If oSystem.Sessions.Count = 0 Then
        Set oSess = oSystem.Sessions.Open("C:\Program Files\E!PC\Sessions\Mainframe.edp")
    Else
        Set oSess = oSystem.ActiveSession
    End If 

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Access - Attachmate Location

(OP)
Perfect. Thank you!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close