BaseTools

×

Warning message

This extension was not updated recently. It might not work with latest versions of OpenOffice.

Primary tabs

Provider:
Roberto Benitez
Maintainer:
rbenitez22
Rating:
3

Average: 3 (1 vote)

Application:
Base
Tags:
base, extension, Base Forms, extension, ThisConnection, extension, ThisDatabaseDocument, extension, Me, extension, PrintForm, extension
Post date:
Thursday, 12 March, 2009 - 13:39
Statistics
Week: Not tracked - Month: Not tracked - Year: Not tracked - Timeline
Download extension
System Independent version - All releases
Compatible with OpenOffice 4: Unknown
User feedback:
Compatible with OpenOffice 4.x?

Beta/Evaluation release

The goal of this extension is to provide a few methods of automating/simplifying certain tasks when working with Base forms (with Basic). Most of the tools have been grouped into the RunCmd module. Other tools have been included in the Forms, Databases and Utils Modules. The Query, Reports and Table modules are currently empty.

see http://baseprogramming.com/Extensions/BaseToolsdesccription.pdf for a more detailed description

See version notes for changes

BaseTools

Version Operating system Compatibility Release date
0.0.5 System Independent 3.4 08/09/2010 - 21:07 More information Download
0.0.3-beta System Independent 3.4 22/02/2010 - 14:07 More information Download
0.0.2-Beta System Independent 3.4 23/03/2009 - 10:19 More information Download
0.0.1 System Independent 3.4 12/03/2009 - 13:44 More information Download

Comments

In order to auto load the Library i had to make a little change in your original code.
globalScope.BasicLibraries.LoadLibrary("BaseTools") instead of BasicLibraries.LoadLibrary("BaseTools") .
With globalscope works like a charm and auto loads the library without me having to load it manually every time I open a file.
other than that, Excellent job this Extension, is Very Usefull.

Hi,
Thanks a lot for these tools. Very useful!
I try to use runCmd.openFormDocument("aForm", event, " aFilterString)
This line is in a function onAButtonClick(event)
I get an error message:
Error. Unable to open form document. Active connection not found.
I'm don't sure it is a bug. Perhaps I miss something. Anyway, I fix this problem replacing...

Function openFormDocument(FormName As String,Optional Event As Object,Optional Filter As String, Optional FormToFilter As Integer, Optional GotoRec As Integer) As Object
Dim Conn As Object
If IsMissing(Event) Then
Conn=ActiveConnection()
Else
Conn=ActiveConnection(event)
End If

... by ...


Function openFormDocument(FormName As String,Optional Event As Object,Optional Filter As String, Optional FormToFilter As Integer, Optional GotoRec As Integer) As Object
Dim Conn As Object

If IsMissing(Event) Then
Conn=ActiveConnection()
Else
Conn=getActiveConnection(event)
End If

I'm trying to use RunCmd.ApplyFilter to apply a filter on a subform when an event is called (choosing a new month on a combobox), so here is the code I use:

Sub MonthSelect(oEvent)
... then I get the month number into iMonthNum
sFilter = "Month = " + iMonthNum
RunCmd.ApplyFilter sFilter, "SubForm-WorkItems" (this is the name of the subform)
End Sub

However this does not work since apparently there is a clash between the name of the SubForm, and the type of the parameter expected by the ApplyFilter function, as so:

Function ApplyFilter(Filter As String,Optional FormName As Object) As Boolean

I wouldn't mind trying to change it myself, but apparently the fact that the extension is loaded into OpenOffice.org macros prevents me from modifying it. Help urgently wanted!

Dear Roberto,

I have difficulties to get started with your set of macros for Base.

Th extension is stored in the "macro" subfolder "Meine Makros" (perhaps "my macros" is the translation for that). I can load your library without an error message, but I can not connect to the database. Do you have a simple example to get started?

Thank you very much in advance

Jürgen

PS: I would like to use Base as front-end for a MySQL database. The forms are created but -as I have no experience in Starbasic- I did not achieve to create macros calling the forms...

I have some docs at http://www.baseprogramming.com/resources.html that may l help you on writing macros and bind to form/form controls.

I am sorry I had not responded--it seems the message did not get forward to my email.

In case you still need help: The extension is best suited for use by macros that are event handlers for a db/db object element (such as data forms and controls in a data form).

To initialize the database variables used throughout the extension, there are 3 options

1: Databases.InitFromDocument(document_name_or_url)
2: Databases.InitFromDocument(db_doc_object) -example: Databases.InitFromDocument(ThisDatabaseDocument)
3) Databases.InitFromEvent(Event_Object) --where event object is event parameter in macro bound to form/form control

Generally, the access starts from a form document--the form document being the global variable ThisComponent. However, note that this variable can be changed easily if any other process, or your macro, activates a different OOo component/document.

There are two functions MeModel(optional event param) and MeController(optional event param) which give you a reference to the active form model/controller. If parameter is not passed, it tries to get a the top data form of the active form document (if the ThisComponent refers to a form document).

examples:
1) get model of form control: Model=MeModel.getByName("txtFirstName")
2) set form filter: RunCmd.ApplyFilter "FirstName='Charles'"
3) run sql command and get result: Result=RunCmd.RunSQL ("SELECT *FROM Employees")

There are more examples in the module called Sandbox in the extension library--these are the tests I run during development.

--hope this helps.