Sorry people I thought this was going to be very easy, but I seem to run into trouble again, I do not seem to be able to grab the resultCd field from the received Json string could it be there is an error again in my code:
Json string received
VBA Code
Json string received
Code:
{"resultCd":"000","resultMsg":"It is succeeded","resultDt":”20231120193115","data”: null}
VBA Code
Code:
Dim Request As Object
Dim stUrl As String
Dim Response As String
Dim requestBody As String
stUrl = "http://localhost:8080/xxxxxxxxxxxxxxxxxxxxxxxxxx"
Set Request = CreateObject("MSXML2.XMLHTTP")
requestBody = strData
With Request
.Open "POST", stUrl, False
.setRequestHeader "Content-type", "application/json"
.send requestBody
Response = .responsetext
End With
If Request.Status = 200 Then
MsgBox Request.responsetext, vbInformation, "Internal Audit Manager"
End If
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim Json As Object
Set rst = db.OpenRecordset("select resultCd FROM [tblCustomerInvoice] WHERE [InvoiceID] = " & Me.CboDocument, dbOpenDynaset)
Set Json = JsonConverter.ParseJson(Request.responsetext)
'Process data.
rst.Edit
rst![resultCd] = Json("resultCd")
rst.Update