Link to home
Start Free TrialLog in
Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia

asked on

Transferring data from Ms access to Java using Json

I have installed the module which is required to be part of Ms Access project in order for the code below to work , I have tried to compile the code below after referencing to MICROSOFT SCRIPT RUNTIME all is fine NO errors

Here is the VBA code that deserializes the JSON text.

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 

Open in new window


What I want is to send the following information from the controls from tblcustomerinvoice and tblinvoicedetailline:

(1) Customer Name (String)
(2) Address (String)
(3) Invoice Number (Integer)
(4) Quantities (Double)
(5) Vat (Double)
(6) Discount (Double)
(7) Price (Double)
(8) TotalPrice (Double)

I want to use to Json language as a way of transferring  data from Ms Access VBA to any system done in Java programming language

How do I use the above code to move data to the requesting program at the time when people are pressing the SAVING BUTTON
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is not my area of expertise but wouldn't it be simpler for Java to just query the Access database.  I'm pretty sure that Java supports SQL.  You just need the correct connection string.