none
Importing JSON (Java Scripting Object Notation) files into Access as a tables RRS feed

  • Question

  • Hello,

    I may have heard that Java has come a long way now that developers have migrated to JSON for distributing client/server database apps.

    I got a JSON file, and I would like to import it into a table.

    There may be a few ways of performing this task as I may have seen a few clips on YouTube.

    I could use the database and record set libraries within the VBA IDE for Access.

    Would I need to add a scripting runtime library as a service reference into the IDE as the first step?

    Regards,

    JohnDBCTX


    jp

    Saturday, September 15, 2018 8:35 AM

All replies

  • The following code snippet would provide users better detail.  

    Already, I have added the Scripting Runtime reference into the VBA IDE, so I can access its libraries.

    Option Compare Database
    Dim DBXJson As Database
    Dim RecSet As Recordset
    Dim jsonObject As Object
    Dim FsoObj As FileSystemObject
    
    Sub JSONtoAccessTable()
    Set jsonObject = FsoObj.OpenTextFile("C:\Users\johnd\Documents\Dictionary Entries.json", ForReading).ReadAll
    
    Set DBXJson = CurrentDb
    
    Set RecSet = DBXJson.OpenRecordset(FsoObj.GetFile.OpenAsTextStream.ReadAll, dbOpenDynaset)
    
    Do Until RecSet.EOF
        
    'code to be added within this block.  Users are welcome to improve this code snippet.
    Loop
    
    
    RecSet.Close
    
    
    
    End Sub
    

    Note that I am being very specific in regards to file importing methods within Access.  If I am in the wrong forum for file importing subjects please let me know.  Part of this is involves VBA coding as well, as well as partially involve developing and importing tables in Access.

    Regards,

    JohnDBCTX


    jp

    Saturday, September 15, 2018 9:10 AM
  • You may like to look over https://access-programmers.co.uk/forums/showthread.php?t=295789

    Daniel Pineault, 2010-2017 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Saturday, September 15, 2018 10:52 AM