Hi Robert,
how would this work for me, where I only want to create a SQL statement
as a string and execute it. Can it be that the string is not recognised
as SQL? (In my MSAccess days it worked). Here the run-time error
indicates that the "Object variable is not set" although it is valid
SQL text and works 'by hand'.
Cheers
Harvey
On Wed, 2023-01-25 at 07:43 +0100, Robert Großkopf wrote:
> Hi Harvey,
>
> why do you want to use Access2Base?
>
> Here a code from German Base Handbuch:
>
> SUB ChangeData(oEvent AS OBJECT)
> DIM oConnection AS OBJECT
> DIM oForm AS OBJECT
> DIM stSql AS STRING
> DIM oSql_Statement AS OBJECT
> DIM inValue AS INTEGER
> oForm = oEvent.Source.Model.Parent
> oConnection = oForm.activeConnection()
> stSQL = oForm.getString(oForm.findColumn("SQL-Code"))
> inValue = MsgBox("Should SQL-Code" & CHR(13) & stSQL & CHR(13) &
> "be executed?", 20, "Execute SQL-Code")
> IF inValue = 6 THEN
> oSQL_Statement = oConnection.createStatement()
> oSQL_Statement.execute(stSql)
> END IF
> END SUB
>
> SQL-Code is part of a table. Field in the table is "SQL-Code". Table
> is
> datasource of a form. A button in this form will be enough to execute
> the macro. You coud update, insert or delete rows by command
> "execute".
>
> Regards
>
> Robert
> --
> Homepage: https://www.familiegrosskopf.de/robert
>
>
--
To unsubscribe e-mail to: [email protected]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy