Ask Your Question
0

calc base connection explanation

asked 2019-08-01 04:30:00 +0100

Baliano gravatar image

I can't understand what's written here

Create a new database with the embedded HSQLDB. Define the tables in Base. Create a spreadsheet as external form for the embedded database to show and update the database. You can do calculations on this form and add charts, the linking is done via form control elements.

from here

https://ask.libreoffice.org/en/questi...

I can add a form, linked to base, in calc but then how I do calculations and charts with it?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-08-01 17:07:22 +0100

updated 2019-08-01 17:14:52 +0100

In the spreadsheet: menu > View > Data Source (F4) to view the database and to choose the table. Drag the top corner of the table into the spreadsheet and work into the one for calculations, graphs, etc. N.B. The database must be registered in order to view it.

If my answer helped you, vote it with ✔ (here on the left)

image description

edit flag offensive delete link more

Comments

That's the solution #2 in the original post:

Create a new database with the embedded HSQLDB. Define the table in Base, drag-drop it to Calc or insert them from data source browser(F4). You get a linked data range "Import". Edit the data in Base and refresh the linked range in Calc.

I'm asking specifically for the method #3

Baliano gravatar imageBaliano ( 2019-08-02 04:12:35 +0100 )edit

Dear @charlie.it ,

If embedded HSQLDB or embedded Firebird database is connected via Calc's BASIC code and :

[1] BASIC code reads Calc's cell content and add it in new record to embedded database.

str1 = oCell.oSheet.GetCellByPosition(1,1).String
str2 = oCell.oSheet.GetCellByPosition(2,1).String  
sql1 = "insert into ""table1"" (""Field1"", ""Field2"") values ('" & str1 & "', " & str2 & "')"
oStatement = db.CreateStatement : Oresult = oStatement.ExecuteQuery(sql1)

And [2] BASIC code loads database into Calc cells.

oCell = oSheet.GetCellByPosition(1,5) : oCell.String = oRowSet.GetString(1)
oCell = oSheet.GetCellByPosition(2,5) : oCell.String = oRowSet.GetString(2)

Is registering embedded database an absolute must ?

lonk gravatar imagelonk ( 2019-10-29 07:51:42 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-08-01 04:30:00 +0100

Seen: 44 times

Last updated: Aug 01 '19