Home > Software engineering >  Real-time error 91, objects, variables, or with variable is not set
Real-time error 91, objects, variables, or with variable is not set

Time:10-01

The first two sentences is cited 8583 that control
Private WithEvents Host As OpenIso8583Service. SCClient
The Public Event Response (iRet As an Integer, RCode As String)


To send data using JSON


'
query balancePrivate Function getCXYEComm () As String
Dim day As the Date
Dim time As the Date
Day=Now
Transmsn_date_time=Format (day, "yyyymmdd")
MessageType="0200"
Procode="CXYE"

Primary_acct_num="1212121234321234312"
Processing_code="301200"
Sys_trace_audit_num="123456"
Acq_inst_id_code="12365432123"
Card_accptr_termnl_id="11110000"
Pin_data="https://bbs.csdn.net/topics/123456"
Msg_authn_code="12341234"





CommHead="{' MessageType: '" + MessageType +"', 'ProcCode' : '" + procode + "', 'Fields' : {
"CommBody=_
"' primary_acct_num ':'" + primary_acct_num + _
"', 'processing_code', '" + processing_code + _
"', 'transmsn_date_time', '" + transmsn_date_time + _
"', 'sys_trace_audit_num', '" + sys_trace_audit_num + _
"', 'acq_inst_id_code', '" + acq_inst_id_code + _
"', 'card_accptr_termnl_id', '" + card_accptr_termnl_id + _
"', 'pin_data', '" + pin_data + _
"', 'msg_authn_code', '" + msg_authn_code + _
"'}}
"GetCXYEComm=CommHead + CommBody


End the Function


This is to open the connection
Private Sub OPEN_Click ()
Set the Host=New OpenIso8583Service. SCClient
Host. Start
End Sub


This is the content of the query button
Private Sub CXYE_Click ()
The Host. The Send (getCXYEComm) & lt; - to debug the error in this line
End Sub

CodePudding user response:

The query execution OPEN_Click before?

CodePudding user response:

Put a breakpoint here

Set the Host=New OpenIso8583Service. SCClient

To see if it was carried out

CodePudding user response:

1, ensure implementation OPEN_Click
2, change the writing:
Private Sub CXYE_Click ()
If Not, the Host Is Nothing Then
The Host. The Send (getCXYEComm)
End the If
End Sub