Pergunte aqui

Perfil de lonk - atividade

2020-02-16 20:06:44 +0100 Medalha recebida  Pergunta notável (fonte)
2020-02-15 18:00:22 +0100 Medalha recebida  Pergunta famosa (fonte)
2020-02-13 02:33:25 +0100 Medalha recebida  Pergunta famosa (fonte)
2020-02-06 17:55:47 +0100 Medalha recebida  Pergunta notável (fonte)
2020-02-04 08:11:50 +0100 Marcada como a melhor resposta Calc BASIC: How to popup a dialog ?

Why ' oDialog.setVisible(True) is not necessary ?

And why does oDialog.Execute() work instead ?

C:\fakepath\0005.ods

2020-02-04 06:47:12 +0100 Marcada como a melhor resposta How to use Copy > Paste Special > Link in Calc
  • Right Click on a cell in Sheet1
    • Select Copy
    • Select Sheet2
    • Right Click on a cell in Sheet2 (or select Edit menu)
    • Select Paste Special > Options: Link / Operations: None / Shift Cells: Don't Shift > OK
    • Nothing happens.
    • Can you please help?
    • [ Fedora 30 - KDE Plasma - LibreOffice 6.2.3.2 installed from package ]
2020-02-04 06:42:30 +0100 Medalha recebida  Pergunta famosa (fonte)
2020-02-04 05:13:14 +0100 Medalha recebida  Pergunta popular (fonte)
2020-02-03 10:32:34 +0100 Pergunta editada Calc BASIC: How to popup a dialog ?

Calc BASIC: How to popup a dialog ? Why ' oDialog.setVisible(True) is not necessary ? [ And why does oDialog.Execute()

2020-02-02 19:26:19 +0100 Medalha recebida  Pergunta famosa (fonte)
2020-01-26 09:12:54 +0100 Medalha recebida  Pergunta notável (fonte)
2020-01-23 04:26:22 +0100 Marcada como a melhor resposta Base | Firebird primary key/autovalue/BigInt field collides with SQL

From the error message of Calc BASIC:

image description

It looks like SQL tried to insert new record with ID=1 but Firebird didn't allow for ID=1 exists.

Did I misunderstand or how can I handle ?

C:\fakepath\0004.ods

C:\fakepath\firebird4ask.odb

2020-01-22 22:45:46 +0100 Medalha recebida  Pergunta popular (fonte)
2020-01-22 22:24:30 +0100 Medalha recebida  Pergunta notável (fonte)
2020-01-22 08:31:57 +0100 Pergunta editada Base | Firebird primary key/autovalue/BigInt field collides with SQL

Base | Firebird primary key/autovalue/BigInt field collides with SQL From the error message: It looks like SQL tried

2020-01-22 08:29:38 +0100 Pergunta editada Base | Firebird primary key/autovalue/BigInt field collides with SQL

Base | Firebird primary key/autovalue/BigInt field collides with SQL From the error message: It looks like SQL tried

2020-01-22 08:29:14 +0100 Pergunta editada Base | Firebird primary key/autovalue/BigInt field collides with SQL

Base | Firebird primary key/autovalue/BigInt field collides with SQL From the error message: It looks like SQL tried

2020-01-20 04:17:43 +0100 Marcada como a melhor resposta BASIC Calc: How to work with various Libraries ?

There are 2 error messages:

image description

image description

C:\fakepath\0003.ods

C:\fakepath\firebird4ask.odb

What was wrong with the code ?

2020-01-19 22:58:24 +0100 Medalha recebida  Pergunta popular (fonte)
2020-01-19 19:14:26 +0100 Medalha recebida  Pergunta notável (fonte)
2020-01-15 08:06:34 +0100 Marcada como a melhor resposta Calc BASIC | How to call Function in other Library ?

Code

'Library1 Module1'
Option Explicit
Sub TestConnectingEmbeddedFirebird1
    Dim iBox%
    iBox = MB_YESNO + MB_DEFBUTTON2 + MB_ICONQUESTION
    If MsgBox ("Do you want to connect embedded Firebird database ?", iBox) = IDYES Then
        On Local Error GoTo CloseConn
        Dim db As Object : db = Library2.Module1.ConnectDatabase("firebird0")
        MsgBox "Embedded Firebird database connected"
        DisconnectDatabase(db)
        MsgBox "Embedded Firebird database disconnected"
    Else
        MsgBox "No embedded Firebird database connected"    
    End IF
    Exit Sub
CloseConn:
    MsgBox "Error " & Err & ": " & Error$ & " (line : " & Erl & ")"
    DisconnectDatabase(db)
End Sub

Sub TestConnectingEmbeddedFirebird2
    On Local Error GoTo CloseConn
    Dim db As Object : db = Library2.Module1.ConnectDatabase("firebird0")
    DisconnectDatabase(db)
    Exit Sub
CloseConn:
    MsgBox "Error " & Err & ": " & Error$ & " (line : " & Erl & ")"
    DisconnectDatabase(db)
End Sub

'Library2 Module1'
Option Explicit
Function ConnectDatabase(dbFilename$) As Object
    Dim dbContext   As Object   : dbContext     = createUNOService("com.sun.star.sdb.DatabaseContext")
    Dim oDataSource As Object   : oDataSource   = dbContext.GetByName(dbFilename)
    ConnectDatabase = oDataSource.GetConnection("","")'("Username","Password")
End Function

Sub TestConnectingEmbeddedFirebird1 or Sub TestConnectingEmbeddedFirebird2 sent the error message:

image description

image description

image description

image description

How can we call Function in other Library (and in order to connect embedded Firebird database) ?

C:\fakepath\0002.ods

2020-01-14 23:05:03 +0100 Medalha recebida  Pergunta popular (fonte)
2020-01-14 06:41:10 +0100 Pergunta editada Calc BASIC | How to call Function in other Library ?

Calc BASIC | How to call Function in other Library ? 'Library1 Module1 Option Explicit Sub TestConnectingEmbedde

2020-01-14 06:38:49 +0100 Pergunta editada Calc BASIC | How to call Function in other Library ?

Calc BASIC | How to call Function in other Library ? 'Library1 Module1 Option Explicit Sub TestConnectingEmbeddedFirebi

2020-01-14 06:36:56 +0100 Pergunta editada Calc BASIC | How to call Function in other Library ?

Calc BASIC | How to call Function in other Library ? 'Library1 Module1 Option Explicit Sub TestConnectingEmbeddedFi

2020-01-14 06:36:18 +0100 Pergunta editada Calc BASIC | How to call Function in other Library ?

Calc BASIC | How to call Function in other Library ? 'Library1 Module1 Option Explicit Sub TestConnectingEmbeddedFirebi

2020-01-14 06:35:46 +0100 Pergunta editada Calc BASIC | How to call Function in other Library ?

Calc BASIC | How to call Function in other Library ? 'Library1 Module1 Option Explicit Sub TestConnectingEmbeddedFirebi

2020-01-14 06:35:14 +0100 Pergunta editada Calc BASIC | How to call Function in other Library ?

Calc BASIC | How to call Function in other Library ? 'Library1 'Module1 Option Explicit Sub TestConnectingEm

2020-01-14 06:31:36 +0100 Pergunta editada Calc BASIC | How to call Function in other Library ?

Calc BASIC | How to call Function in other Library ? 'Library1 'Module1 Option Explicit Sub TestConnectingEm

2020-01-14 06:28:43 +0100 Pergunta editada Calc BASIC | How to call Function in other Library ?

Calc BASIC | How to call Function in other Library ? 'Library1 'Module1 Option Explicit Sub TestConnectingEm

2020-01-14 06:28:08 +0100 Pergunta editada Calc BASIC | How to call Function in other Library ?

Calc BASIC | How to call Function in other Library ? 'Library1 'Module1 Option Explicit Sub TestConnectingEmbeddedFirebi

2020-01-08 14:18:41 +0100 Medalha recebida  Pergunta famosa (fonte)
2020-01-08 02:46:45 +0100 Resposta comentada How can query run faster ?

Dear @pierre-yves samyn, Thank you so much, queries run only 1 second instead of nearly 50 seconds and point EOF within

2020-01-08 02:18:21 +0100 Marcada como a melhor resposta How can query run faster ?

Regarding the attached Firebird database, running queries namely AccountCodeLevel123456b or AccountCodeLevel123456c takes nearly 50 seconds and going to EOF takes nearly 50 seconds more as well. Is it possible to make them run faster ?C:\fakepath\firebird0.odb

2020-01-07 20:31:30 +0100 Medalha recebida  Pergunta notável (fonte)