Reading Results from DDQ form
Reading Results from DDQ form
(OP)
I am trying to read the results of DDQ form. I can open the form, enter search data and execute it. I can then execute the command to view the detail. The detail view is displayed but I can not read or control any data or commands on the form.
Any assistance is greatly appreciated. Below is the code I have thus far...
Dim objDDQ541 As ddq541.MimsApplication
Dim iRow As Integer
Dim strReqID As String
Dim strReqDesc As String
Dim frm As Object
Dim cmd As Object
Dim ind As Object
Set objDDQ541 = New ddq541.MimsApplication
objDDQ541.Session.Login 1, fasle
objDDQ541.New
objDDQ541.ActivateDefaultView
iRow = 2
Do While Worksheets(2).Cells(iRow, 1).Value
objDDQ541.SearchView.Inputs(0, "EquipRef") = Worksheets(2).Cells(iRow, 2).Value
objDDQ541.SearchView.Inputs(0, "Status") = "U"
objDDQ541.SearchView.Inputs(0, "Classification") = "EF"
objDDQ541.SearchView.Inputs(0, "SearchMethod") = "A"
objDDQ541.SearchView.StartSearch
'Go through the results
For i = 0 To objDDQ541.SearchView.OutputInstances - 1
Worksheets(2).Cells(iRow, 12).Value = Worksheets(2).Cells(iRow, 12).Value & objDDQ541.SearchView.Outputs(i, "RequestId") & " - " & objDDQ541.SearchView.Outputs(i, "RequestIdD1") & Chr(10)
'Debug.Print objDDQ541.SearchView.OutputNames(i) & "= " & objDDQ541.SearchView.Outputs(i, objDDQ541.SearchView.OutputNames(i))
objDDQ541.SearchView.Activate
Set cmd = objDDQ541.Commands.Item("detail")
cmd.Inputs(0, "RequestId") = objDDQ541.SearchView.Outputs(i, "RequestID")
'objDDQ541.Commands.Item("detail").Inputs(0, "RequestId") = objDDQ541.SearchView.Outputs(i, "RequestID")
cmd.Modeless = True
'objDDQ541.Commands.Item("Detail").Modeless = True
cmd.Execute
'objDDQ541.Commands.Item("Detail").Execute
Set frm = objDDQ541.DetailViews.Item(0)
frm.Activate
objDDQ541.DetailViews.Item(0).Activate
'Search Command
objDDQ541.Commands.Item("search").Modeless = True
'objDDQ541.Commands.Item("search").Inputs(0, "RequestId") = ""
'objDDQ541.Commands.Item("search").Inputs(0, "Location") = ""
objDDQ541.Commands.Item("search").Inputs(0, "EquipRef") = objDDQ541.SearchView.Outputs(i, "RequestID")
'objDDQ541.Commands.Item("search").Inputs(0, "EquipNo") = ""
objDDQ541.Commands.Item("search").Execute
Next i
iRow = iRow + 1
Loop
'EnumObject objDDQ541 'Read the data to see what is there
'EnumCommands objDDQ541
For i = 0 To objDDQ541.Commands.Item("detail").OutputNameCount - 1
'Debug.Print objDDQ541.Commands.Item("Search").OutputNames(i) & " = " & objDDQ541.Commands.Item("Search").Outputs(0, objDDQ541.Commands.Item("Search").OutputNames(i))
Debug.Print objDDQ541.Commands.Item("Detail").OutputNames(i) & " = " & objDDQ541.Commands.Item("Detail").Outputs(0, objDDQ541.Commands.Item("Detail").OutputNames(i))
'Debug.Print objDDQ541.Commands.Item("Search").InputNames(i) & " = " & objDDQ541.Commands.Item("search").Inputs(1, objDDQ541.Commands.Item("search").InputNames(i))
'Debug.Print cmd.OutputNames(i) & " = " & cmd.Outputs(i, cmd.OutputNames(i))
Next i
objDDQ541.Quit
ClearObject objDDQ541
'***********
Cheers,
Alex
Any assistance is greatly appreciated. Below is the code I have thus far...
Dim objDDQ541 As ddq541.MimsApplication
Dim iRow As Integer
Dim strReqID As String
Dim strReqDesc As String
Dim frm As Object
Dim cmd As Object
Dim ind As Object
Set objDDQ541 = New ddq541.MimsApplication
objDDQ541.Session.Login 1, fasle
objDDQ541.New
objDDQ541.ActivateDefaultView
iRow = 2
Do While Worksheets(2).Cells(iRow, 1).Value
objDDQ541.SearchView.Inputs(0, "EquipRef") = Worksheets(2).Cells(iRow, 2).Value
objDDQ541.SearchView.Inputs(0, "Status") = "U"
objDDQ541.SearchView.Inputs(0, "Classification") = "EF"
objDDQ541.SearchView.Inputs(0, "SearchMethod") = "A"
objDDQ541.SearchView.StartSearch
'Go through the results
For i = 0 To objDDQ541.SearchView.OutputInstances - 1
Worksheets(2).Cells(iRow, 12).Value = Worksheets(2).Cells(iRow, 12).Value & objDDQ541.SearchView.Outputs(i, "RequestId") & " - " & objDDQ541.SearchView.Outputs(i, "RequestIdD1") & Chr(10)
'Debug.Print objDDQ541.SearchView.OutputNames(i) & "= " & objDDQ541.SearchView.Outputs(i, objDDQ541.SearchView.OutputNames(i))
objDDQ541.SearchView.Activate
Set cmd = objDDQ541.Commands.Item("detail")
cmd.Inputs(0, "RequestId") = objDDQ541.SearchView.Outputs(i, "RequestID")
'objDDQ541.Commands.Item("detail").Inputs(0, "RequestId") = objDDQ541.SearchView.Outputs(i, "RequestID")
cmd.Modeless = True
'objDDQ541.Commands.Item("Detail").Modeless = True
cmd.Execute
'objDDQ541.Commands.Item("Detail").Execute
Set frm = objDDQ541.DetailViews.Item(0)
frm.Activate
objDDQ541.DetailViews.Item(0).Activate
'Search Command
objDDQ541.Commands.Item("search").Modeless = True
'objDDQ541.Commands.Item("search").Inputs(0, "RequestId") = ""
'objDDQ541.Commands.Item("search").Inputs(0, "Location") = ""
objDDQ541.Commands.Item("search").Inputs(0, "EquipRef") = objDDQ541.SearchView.Outputs(i, "RequestID")
'objDDQ541.Commands.Item("search").Inputs(0, "EquipNo") = ""
objDDQ541.Commands.Item("search").Execute
Next i
iRow = iRow + 1
Loop
'EnumObject objDDQ541 'Read the data to see what is there
'EnumCommands objDDQ541
For i = 0 To objDDQ541.Commands.Item("detail").OutputNameCount - 1
'Debug.Print objDDQ541.Commands.Item("Search").OutputNames(i) & " = " & objDDQ541.Commands.Item("Search").Outputs(0, objDDQ541.Commands.Item("Search").OutputNames(i))
Debug.Print objDDQ541.Commands.Item("Detail").OutputNames(i) & " = " & objDDQ541.Commands.Item("Detail").Outputs(0, objDDQ541.Commands.Item("Detail").OutputNames(i))
'Debug.Print objDDQ541.Commands.Item("Search").InputNames(i) & " = " & objDDQ541.Commands.Item("search").Inputs(1, objDDQ541.Commands.Item("search").InputNames(i))
'Debug.Print cmd.OutputNames(i) & " = " & cmd.Outputs(i, cmd.OutputNames(i))
Next i
objDDQ541.Quit
ClearObject objDDQ541
'***********
Cheers,
Alex
RE: Reading Results from DDQ form
An alternative may be to call the Mincom Object "behind" the DDQ541 application. Mincom have a product called Mincom Connector which is a wrapper (mimsx.dll) which exposes a COM interface to the Mincom MSO programs and the Mincom MSK programs (the Mincom Objects). There are a number of other posts in this forum which relate to Connector questions.
I'm guessing (by the "541" numbers in DDQ541) that you're after work request information, and in the copy of Connector doco I have I can see a Mincom Object called "WORKREQUEST". It has a method of "Retrieve" which would probably return the info you're after (without the overhead of running the DDQ application).
RE: Reading Results from DDQ form
I will have a look at it. You were correct in assuming that it is related to the wok request (custom modified form).
Unfortunately I have limited access to the relative documentation, so any information you have would be greatly appreciated.
Cheers,
Alex
RE: Reading Results from DDQ form
Things you can do without doco:
1. Run msqmom.exe.
This lives in the "bin" folder where the other Mincom Ellipse client programs reside (ie. all the other msqxxx.exe programs). The msqmom (M=Mincom, O=Object, M=Model) shows a view of all the Classes(Objects) and Operations(Methods) which exist.
2. View Ellipse Data "OBMH" table via MSO010
This data is the "link" which translates the Object/Method (as seen in msqmom) to the cobol back-end program (ie the MSKxxx.CBL)
3. See if there are code samples on other threads
Here is an example of an EQUIPMENT.Retrieve
RE: Reading Results from DDQ form
Thanks for all your help!
Cheers,
Alex