?
Solved

AS400 Interaction/Screen Scraping with VB6

Posted on 2004-08-25
10
Medium Priority
?
547 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
7 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

864 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