Solved

AS400 Interaction/Screen Scraping with VB6

Posted on 2004-08-25
10
527 Views
Last Modified: 2013-12-25
We have an application that uses Access97 to Pull/Modify in an FDR (AS400) system.  Currently the system perfoms a "Wait" for 5 seconds after each input to make sure that the screen refreshes and processing is completed.

We are converting the application into VB6 and I was wondering if anyone out there has an idea that will alow us to eliminate the waits.  We would like to see the VB App check to make sure that the AS400 is done processing and then move to the next step.

We are using Extra Personal Client to interface.

Mucho points to anyone that can help!  Thanks!
0
Comment
Question by:tulsajames
  • 4
  • 3
10 Comments
 

Author Comment

by:tulsajames
ID: 11913447
Come on people.  We need some help here.  :(
0
 
LVL 2

Expert Comment

by:MrPan
ID: 11943097
Where are the waits. I normally connect directly to the as400 data.

If you show some sample code maybe I can help but normall it is just a case of connecting and reading.
0
 
LVL 2

Expert Comment

by:MrPan
ID: 11943170
My code

You have posted this in the wrong section if you move this to VB instead of vbcontrols you might of got a quicker reply

'Create connection
   dim adoINVOLIB as ADODB.Connection

    Set adoINVOLIB = New ADODB.Connection

   
'Connect to lib involib as400
    With adoINVOLIB
        .ConnectionString = "Provider=IBMDA400.DataSource.1;Persist Security Info=False;User ID=USER;Data Source=AS400name"
        .ConnectionTimeout = 120
        .Open
    End With

dim rsReport as adodb.recordset

    Set rsReport = New ADODB.Recordset
     rsReport.Open "SELECT * FROM LIB.FILE",  adoINVOLIB, adOpenKeyset, adLockOptimistic

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:tulsajames
ID: 11943195
This is a sample of code we use currently...

Please keep in mind this is NOT my code ;)  We are trying to make the system more efficient.

Public Sub PCC(AcctNum As String, PccCode As String)

'no changes necessary for 2-6-04 FDR install

'**************  Update PCC code **********************************

   Set Sess0 = GetObject("C:\Program Files\E!Pc\Sessions/Fdr.edp")

   Sess0.Screen.SendKeys ("<Home>")
   Sess0.Screen.SendKeys ("NM CL2 " & AcctNum)
   Sess0.Screen.SendKeys ("<Enter>")
   Sess0.Screen.waithostquiet (500)
   
   Dim FDRScreen
   FDRScreen = Sess0.Screen.select(6, 29, 6, 31)
   
  If PccCode = FDRScreen Then
            Exit Sub
    Else
               Sess0.Screen.moveto 6, 29
               Sess0.Screen.SendKeys (PccCode)
               Sess0.Screen.SendKeys ("<Enter>")
               Sess0.Screen.waithostquiet (500)
               
                TranComplete = Sess0.Screen.select(24, 11, 24, 44)
           
            If TranComplete = "TRANSACTION COMPLETED SUCCESSFULLY" Then
              Else
                MsgBox "FDR PCC CODE UPDATE WAS UNSUCCESSFUL"
                Exit Sub
            End If
End If

End Sub
0
 

Author Comment

by:tulsajames
ID: 11943205
As far as a direct connection is concerned, our IT department will not give us access to the FDR.  They are a bit parinoid about the whole thing...
0
 
LVL 2

Accepted Solution

by:
MrPan earned 500 total points
ID: 11943528
By looking as this code I assume that

TranComplete = ess0.Screen.select(24, 11, 24, 44)

checks for a successful completion I would try something like this

dim I as long

Do while TranComplete <> "TRANSACTION COMPLETED SUCCESSFULLY" and I <100000
       tranComplete = ess0.Screen.select(24, 11, 24, 44)
       I=I+1
Loop

The I is included to ensure that the loops does not go on for ever.

I have not used this method which I assume is screen scrapping. May be better if this was posted to the as400 section as the obects appear to be as400. But the above should mean that when the transaction is complete the program continues.

Enjoy 8)


0
 
LVL 2

Expert Comment

by:MrPan
ID: 11943553
Sorry a bit more explanation

The I is included to ensure that the loops does not go on for ever if the screen is not upated with the TRANSACTION COMPLETED SUCCESSFULLY message. Change the value in the loop until you find a value that suites. Or if there is a failure message include that in the loop and process accordingly.

I am off home now so want be able to add any more today. I will check tomorrow to see how you got on.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Write data from SQL to CSV file - position 1 60
Add a task in Outlook from access 11 39
Recommendation vb6 to vb.net or others 14 148
Zip Folders Using Chilkat Routines 1 39
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question