Advertisement
| 10.15.2008 at 12:03PM PDT, ID: 23817921 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: |
Private Sub btnConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click
CreateNew(txtIP.Text, txtUserID.Text, txtPassword.Text, _
txtLibrary.Text, txtProgram.Text)
End Sub
Private Sub btnSendCommand_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendCommand.Click
Dim stringConverter As cwbx.StringConverter = New cwbx.StringConverterClass()
'Dim parameters As cwbx.ProgramParameters = New cwbx.ProgramParametersClass()
'parameters.Append("Parameter1Name", cwbx.cwbrcParameterTypeEnum.cwbrcInout, 12)
'stringConverter.Length = 12
'parameters("Parameter1Name").Value = stringConverter.ToBytes("SomeString".PadRight(12, " "c))
Dim prmParameterList As New cwbx.ProgramParameters
Dim prmParameter As cwbx.ProgramParameter
Try
prmParameter = prmParameterList.Append("PRINTPARAM", cwbx.cwbrcParameterTypeEnum.cwbrcInout)
stringConverter.Length = 6
prmParameter.Value = stringConverter.ToBytes("OUTPUT (*PRINT)".PadRight(15, " "c))
SendCommand(prmParameterList)
Catch ex As Exception
Output("Error sending command" & vbCrLf & ex.Message)
End Try
End Sub
Public Sub CreateNew(ByVal strAS400 As String, ByVal strUserID As String, _
ByVal strPassword As String, ByVal strLibrary As String, _
ByVal strProgram As String)
If Not mblnConfigured Then
as400 = New cwbx.AS400SystemClass()
prgAS400Program = New cwbx.Program()
Try
as400.Define(strAS400)
Try
With prgAS400Program
.system = as400
.system.UserID = strUserID
.system.Password = strPassword
' .libraryName = strLibrary
.ProgramName = strProgram
End With
Catch e As Exception
as400 = Nothing
prgAS400Program = Nothing
End Try
Try
as400.Connect(cwbx.cwbcoServiceEnum.cwbcoServiceRemoteCmd)
Catch ex As Exception
End Try
Catch ex As Exception
as400 = Nothing
prgAS400Program = Nothing
End Try
End If
End Sub
Public Sub SendCommand(ByRef prmParameterList As cwbx.ProgramParameters)
Try
If as400.IsConnected(cwbx.cwbcoServiceEnum.cwbcoServiceRemoteCmd) = 0 Then
' Lost connection with the AS400. Disconnect, then reconnect.
as400.Disconnect(cwbx.cwbcoServiceEnum.cwbcoServiceAll)
as400.Connect(cwbx.cwbcoServiceEnum.cwbcoServiceRemoteCmd)
End If
prgAS400Program.Call(prmParameterList)
Catch e As Exception
' Capture to log the errors
If as400.Errors.Count > 0 Then
Dim intAS400IX As Int16 = 0
' Log something here.
For Each [error] As cwbx.Error In as400.Errors
intAS400IX += 1
Next
End If
If prgAS400Program.Errors.Count > 0 Then
Dim intPRGIX As Int16 = 0
' Log something here.
For Each [error] As cwbx.Error In prgAS400Program.Errors
intPRGIX += 1
Next
End If
End Try
End Sub
|
Advertisement