Solved

AS400 Interaction/Screen Scraping with VB6

Posted on 2004-08-25
10
526 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now