Access2Base

Was ist Access2Base?

Access2Base is a LibreOffice BASIC library of macros for (business or personal) application developers and advanced users. It is one of the libraries stored in "Application macros and dialogs".

The functionalities provided by the implemented macros are all directly inspired by Microsoft Access. The macros are callable mainly from a LibreOffice Base application, but also from any LibreOffice document (Writer, Calc, ...) where access to data stored in a database makes sense.

Die API, die durch Access2Base bereitgestellt wird, ist dafür gedacht, kompakter, intuitiver und einfacher erlernbar zu sein als die Standard UNO-API (API = Application Programming Interface; zu deutsch Anwendungsprogrammierschnittstelle).

Warnsymbol

Die Bibliothek ist Online dokumentiert auf http://www.access2base.com (englisch).


Die bereitgestellten Makros enthalten:

  1. Eine vereinfachte und erweiterbare API für die Manipulation von Formularen, Dialogen und Steuerelementen, ähnlich dem Microsoft Access-Objektmodell,

  2. eine API für den Datenbankzugriff auf die Objekte Tabelle, Abfrage, Datensatz und Feld,

  3. eine Anzahl an Aktionen mit einer Syntax, die ihren Microsoft Access-Makros/Aktionen entsprechen,

  4. die Datenbankfunktionen DLookup, DSum …,

  5. die Unterstützung der Kurzschreibweise wie Forms!myForm!myControl

und zusätzlich

  1. ein konsequentes Fehler- und Ausnahmesteuerungsprogramm,

  2. Möglichkeiten, Ereignisse für Formulare, Dialoge und Steuerelemente zu programmieren und

  3. Unterstützung sowohl für eingebettete als auch für eigenständige (Writer-)Formulare.

Vergleich von Access2Base mit Microsoft Access VBA


   REM Open a form ... 
             OpenForm("myForm") 
   REM Move a form to new left-top coordinates ... 
             Dim ofForm As Object  ' In VBA =>  Dim ofForm As Form 
             Set ofForm = Forms("myForm") 
             ofForm.Move(100, 200) 
   REM Get the value of a control ... 
             Dim ocControl As Object 
             ocControl = ofForm.Controls("myControl") 
             MsgBox ocControl.Value 
   REM Hide a control ... 
             ocControl.Visible = False 
   REM ... or alternatively ... 
             setValue("Forms!myForm!myControl.Visible", False)  '  Shortcut notation 
             ' In VBA =>  Forms!myForm!myControl.Visible = False