Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 1

Exporting Data from Ms Access VBA to Json language

Dear All;

 

I need help on how to serialize the data from MS Access VBA to Json , the data will be used by some other programs, and so Json is coming as way of provide a better data exchange property. I have installed Json Discretionary as part of Ms Access VBA project to help serialize/de-serialize the data.

 

For de-seliarize here is the code below:

Public Sub Example()
Dim JSONString As String
JSONString = "{""Name"":""Value""}"
Dim JSON As cJSON
Set JSON = New cJSON
Dim D As Dictionary
Set D = JSON.Deserialize(JSONString)
If (JSON.IsOk()) Then
MsgBox D.Item("Name")            'shows Value
Else
MsgBox JSON.ShowWhyNotOk()
End If
Set D = Nothing
Set JSON = Nothing
End Sub
 
The problem is how to do the same if I want to send the data to the requesting external program. I admit I'm still new to this forum and I have no experience in VBA/Json.
 
I want to exchange the following fields from Ms Access Tables (tblcustomerinvoice/tblInvoicedetails)
(1) Customer Name (String)
(2) Invoice number (Integer)
(3) Address (string)
(4) Quantities sold (Double)
(5) Selling Price as (Double)
(6) Total Value (Double)
 
 
Any idea here will be highly appreciated
 
Regard
Chris