Solved

AS400 Interaction/Screen Scraping with VB6

Posted on 2004-08-25
10
523 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

762 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

19 Experts available now in Live!

Get 1:1 Help Now