OpenOffice Base and Basic

Discuss the database features
Post Reply
ManUtd
Posts: 2
Joined: Sat Dec 03, 2022 8:57 am

OpenOffice Base and Basic

Post by ManUtd »

hello everyone
i am just starting my way with openoffice, i have done a lot of reading, downloaded some good ebooks and did couple of practical exercises.
However, i couldnt find an answer for the following question:
is it possible to access the database and tables created with openoffice base using openoffice basic?
what i am thinking is something like visual fox pro where you create a table then from inside the program you manipulate it by opening the table, appending to it , edit , index and search.
I just couldn't find anything in the manual of BASIC.
I appreciate any feed back with this issue.
regards
Openoffice 4.1.1.3
Windows
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: OpenOffice Base and basic

Post by John_Ha »

ManUtd wrote: Sat Dec 03, 2022 9:08 am i am just starting my way with openoffice
AOO is walking dead - you are well advised to start with the actively developed LibreOffice.

Almost certainly yes.

See Apache OpenOffice BASIC Programming Guide.

Also see Developers Guide_OOo3.1.0.pdf.

Look at Macros and UNO API

YOu can with macros - see Andrew Pitonyak's OpenOffice Macro Information
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: OpenOffice Base and basic

Post by RoryOF »

ManUtd wrote: Sat Dec 03, 2022 9:08 am
is it possible to access the database and tables created with openoffice base using openoffice basic?
what i am thinking is something like visual fox pro where you create a table then from inside the program you manipulate it by opening the table, appending to it , edit , index and search.
I just couldn't find anything in the manual of BASIC.
In the OpenOffice BASIC manual there are ten pages on accessing the OpenOffice Database; Chapter 10 in my copy.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: OpenOffice Base and basic

Post by F3K Total »

Hello,
you need to use SQL-commands to modify the database.
These commands can be executed by Starbasic.
Find attached an example file, containing BasicCode for
  • create table
  • insert rows
  • update rows (modify)
  • delete rows
  • drop table
open the Form and hit the buttons top/down
after each button analyse the tables area/table itself

EDIT: Ups, nobody told me, that the file wasn't working.
I attached a improved version now.
EDIT2: further improved the file
Attachments
BASE_BASIC.odb
(12.85 KiB) Downloaded 82 times
Last edited by F3K Total on Sun Dec 04, 2022 6:27 pm, edited 2 times in total.
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
ManUtd
Posts: 2
Joined: Sat Dec 03, 2022 8:57 am

Re: OpenOffice Base and basic

Post by ManUtd »

RoryOF wrote: Sat Dec 03, 2022 3:48 pm
ManUtd wrote: Sat Dec 03, 2022 9:08 am
is it possible to access the database and tables created with openoffice base using openoffice basic?
what i am thinking is something like visual fox pro where you create a table then from inside the program you manipulate it by opening the table, appending to it , edit , index and search.
I just couldn't find anything in the manual of BASIC.
In the OpenOffice BASIC manual there are ten pages on accessing the OpenOffice Database; Chapter 10 in my copy.
Thanks for you reply
did you mean the "Apache OpenOffice BASIC Programming Guide" when you said the "openOffice BASIC manual" ?? because it didnt even have a chapter 10!!! could you please provide me with a link to the manual you referred to!!
Regards
Openoffice 4.1.1.3
Windows
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: OpenOffice Base and basic

Post by RoryOF »

Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: OpenOffice Base and basic

Post by John_Ha »

The OpenOffice.org 3.1 Developer's Guide I recommended has
Chapter 11: OpenOffice.org Basic...................................................................................1109
First Steps with OpenOffice.org Basic......................................................................1110
Step By Step Tutorial ..........................................................................................1110
Creating a Module in a Standard Library..................................................................1110
Writing and Debugging a Basic UNO program.........................................................1112
Calling a Sub from the User Interface.......................................................................1114
Creating Dialogs.......................................................................................................1115
Adding Event Handlers.............................................................................................1117
AutoPilot Dialogs......................................................................................................1119
OpenOffice.org Basic IDE........................................................................................1120
Managing Basic and Dialog Libraries.......................................................................1121
OpenOffice.org Basic Macros Dialog.......................................................................1121
Displayed Information...............................................................................................1121
Buttons.....................................................................................................................1123
OpenOffice.org Basic Macro Organizer Dialog.........................................................1124
Modules....................................................................................................................1124
Dialogs.....................................................................................................................1125
Libraries...................................................................................................................1127
Basic IDE Window....................................................................................................1131
Basic Source Editor and Debugger..........................................................................1133
Dialog Editor.............................................................................................................1135
Assigning Macros to GUI Events..............................................................................1140
Dialog Localization...................................................................................................1141
Technical Background..............................................................................................1146
Features of OpenOffice.org Basic............................................................................1147
Functional Range Overview.....................................................................................1148
Screen I/O Functions................................................................................................1148
File I/O......................................................................................................................1149
Date and Time Functions.........................................................................................1150
Numeric Functions...................................................................................................1151
String Functions.......................................................................................................1151
Specific UNO Functions...........................................................................................1152
Accessing the UNO API...........................................................................................1152
StarDesktop .......................................................................................................1152
ThisComponent ..................................................................................................1153
Special Behavior of OpenOffice.org Basic...............................................................1154
Threads ..............................................................................................................1155
Rescheduling .....................................................................................................1155
Advanced Library Organization................................................................................1157
General Structure.....................................................................................................1157
Accessing Libraries from Basic................................................................................1158
Library Container Properties in Basic .................................................................1158
Loading Libraries ................................................................................................1159
Library Container API .........................................................................................1160
Variable Scopes.......................................................................................................1163
Programming Dialogs and Dialog Controls..............................................................1164
Dialog Handling........................................................................................................1165
Showing a Dialog.....................................................................................................1165
Getting the Dialog Model..........................................................................................1166
Dialog as Control Container.....................................................................................1166
Dialog Properties......................................................................................................1166
Common Properties.................................................................................................1167
Multi-Page Dialogs...................................................................................................1168
Dialog Controls.........................................................................................................1168
Command Button.....................................................................................................1168
Image Control...........................................................................................................1169
Check Box................................................................................................................1170
Option Button...........................................................................................................1170
Label Field................................................................................................................1171
Text Field..................................................................................................................1171
List Box....................................................................................................................1172
Combo Box..............................................................................................................1173
Horizontal/Vertical Scroll Bar....................................................................................1174
Group Box................................................................................................................1175
Progress Bar............................................................................................................1175
Horizontal/Vertical Line.............................................................................................1176
Date Field.................................................................................................................1176
Time Field.................................................................................................................1177
Numeric Field...........................................................................................................1177
Currency Field..........................................................................................................1177
Formatted Field........................................................................................................1178
Pattern Field.............................................................................................................1178
File Control...............................................................................................................1179
Creating Dialogs at Runtime....................................................................................1180
Library File Structure................................................................................................1183
Application Library Container...................................................................................1184
Libraries without Password Protection ...............................................................1185
Libraries with Password Protection ....................................................................1186
Document Library Container....................................................................................1187
Library Deployment..................................................................................................1188
Package Structure ..............................................................................................1189
Path Settings ......................................................................................................1190
Additional Options ..............................................................................................1191

Chapter 12: Database Access...................................................................................1193
Platform Independence ......................................................................................1193
Functioning of the OpenOffice.org API Database Integration .............................1194
Integration with OpenOffice.org API ...................................................................1194
Architecture..............................................................................................................1195
Example: Querying the Bibliography Database........................................................1195
Data Sources in OpenOffice.org API........................................................................1197
DatabaseContext ...............................................................................................1197
DataSources............................................................................................................1199
The DataSource Service..........................................................................................1199
Adding and Editing Datasources ........................................................................1201
Queries....................................................................................................................1202
Adding and Editing Predefined Queries...................................................................1203
Runtime Settings For Predefined Queries................................................................1206
The SingleSelectQueryComposer............................................................................1208
The SQLQueryComposer........................................................................................1212
Forms and Reports..................................................................................................1214
Document Links.......................................................................................................1218
Tables and Columns................................................................................................1219
Connections.............................................................................................................1224
Understanding Connections ...............................................................................1224
Data Definition ...................................................................................................1227
Operation on Application Level ..........................................................................1227
Connecting Through a DataSource..........................................................................1227
Connecting Using the DriverManager and a Database URL....................................1229
Connecting Through a Specific Driver......................................................................1230
Driver Specifics........................................................................................................1231
Driver Specifics ..................................................................................................1231
The SDBC Driver for JDBC......................................................................................1232
The SDBC Driver for ODBC.....................................................................................1233
The SDBC Driver for Adabas D................................................................................1234
The SDBC Driver for ADO........................................................................................1234
The SDBC Driver for dBase.....................................................................................1234
The SDBC Driver for Flat File Formats....................................................................1235
The SDBC Driver for OpenOffice.org Calc Files......................................................1236
The SDBC Driver for address books........................................................................1237
The SDBC Driver for embedded HSQL databases..................................................1237
Connection Pooling..................................................................................................1237
Piggyback Connections............................................................................................1239
Manipulating the Data..............................................................................................1239
The RowSet Service................................................................................................1239
Usage.......................................................................................................................1240
Events and Other Notifications.................................................................................1245
Clones of the RowSet Service.................................................................................1248
Statements...............................................................................................................1249
Creating Statements................................................................................................1250
Inserting and Updating Data....................................................................................1251
Getting Data from a Table........................................................................................1253
Result Sets...............................................................................................................1254
Retrieving Values from Result Sets..........................................................................1257
Moving the Result Set Cursor..................................................................................1257
Using the getXXX Methods......................................................................................1258
Scrollable Result Sets..............................................................................................1261
Modifiable Result Sets.............................................................................................1264
Update.....................................................................................................................1265
Insert........................................................................................................................1267
Delete.......................................................................................................................1269
Seeing Changes in Result Sets...............................................................................1270
ResultSetMetaData..................................................................................................1272
Using Prepared Statements.....................................................................................1272
When to Use a PreparedStatement Object ........................................................1273
Creating a PreparedStatement Object ...............................................................1273
Supplying Values for PreparedStatement Parameters .......................................1273
PreparedStatement From DataSource Queries.......................................................1275
Database Design.....................................................................................................1276
Retrieving Information about a Database ...........................................................1276
Determining Feature Support .............................................................................1277
Database Limits .................................................................................................1278
SQL Objects and their Attributes ........................................................................1278
Using DDL to Change the Database Design............................................................1279
Using SDBCX to Access the Database Design........................................................1283
The Extension Layer SDBCX .............................................................................1283
Catalog Service........................................................................................................1284
Table Service...........................................................................................................1285
Column Service........................................................................................................1287
Index Service...........................................................................................................1289
Key Service..............................................................................................................1290
View Service............................................................................................................1292
Group Service..........................................................................................................1292
User Service............................................................................................................1293
The Descriptor Pattern.............................................................................................1294
Adding an Index.......................................................................................................1297
Creating a User........................................................................................................1297
Adding a Group........................................................................................................1298
Using DBMS Features.............................................................................................1298
Transaction Handling .........................................................................................1298
Stored Procedures...................................................................................................1299
Writing Database Drivers.........................................................................................1300
SDBC Driver............................................................................................................1301
Driver Service..........................................................................................................1302
Connection Service..................................................................................................1303
XDatabaseMetaData Interface.................................................................................1305
Statements...............................................................................................................1306
PreparedStatement ............................................................................................1306
Result Set ..........................................................................................................1307
Support Scalar Functions.........................................................................................1307
Open Group CLI Numeric Functions........................................................................1307
Open Group CLI String Functions............................................................................1308
Open Group CLI Time and Date Functions..............................................................1309
Open Group CLI System Functions.........................................................................1310
Open Group CLI Conversion Functions...................................................................1311
Handling Unsupported Functionality.........................................................................1311
The Basic Programming Guide links to Database Access
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: OpenOffice Base and Basic

Post by F3K Total »

i improved the sample file here
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
Post Reply