Share My Creation [BANanoVuetifyAD3] BANanoServer - Direct MS-ACCESS CRUD

Hi there

A rather incredible opportunity!!! I mean accessing MS-ACCESS databases directly from the jetty server with jSQL.

Download

This has been rather a tricky exercise.

1st, thanks to @Erel post here. BTW, you need to follow the steps on that post first to make this work.


2nd @OliverA , pointed us to to solve the CRUD issue, here.


Which originally was found by @jmon back in 2017.


DirectMSAccess.jpg


We have set up the DataSource to point to the location of our db.

1636968503620.png


Then in SERVERIndex...

B4X:
Dim dDB As DirectDB
    dDB.Initialize
    If dDB.OpenMSAccess(File.DirApp, dbname) Then
        Select Case scommand
        Case "insert", "update", "delete", "createtable"
            dDB.SQLRunQuery(query, args)
            payload2browser.Put("error", dDB.error)
            payload2browser.Put("ok", dDB.ok)
            payload2browser.Put("result", returnList)
        Case Else
            returnList = dDB.SQLExecuteMaps(query, args)
            payload2browser.Put("error", dDB.error)
            payload2browser.Put("ok", dDB.ok)
            payload2browser.Put("result", returnList)
        End Select
        dDB.SQLClose
    Else
        payload2browser.Put("error", "Cannot connect to the database!")
        payload2browser.Put("ok", False)
        payload2browser.Put("result", returnList)
    End If   
    ws.RunFunction("directmsaccessonbrowser_result", Array(payload2browser))
    ws.Flush    ...

The OpenMSAccess commands include...

B4X:
    Dim dbPath As String = File.Combine(Dir, fileName)
        dbPath = dbPath.Replace("\","/")
        aSQL.Initialize("net.ucanaccess.jdbc.UcanaccessDriver", $"jdbc:ucanaccess://${dbPath}"$)

This should be available soon:


 
Top