How to use INSERT mysql query in macro

Creating a macro - Writing a Script - Using the API

How to use INSERT mysql query in macro

Postby kububa » Thu Jul 31, 2008 6:48 pm

I have a simple question: How to use INSERT mysql query in OpenOffice Basic macro to insert new records into table?
I would like to macro use current connection to the database (mysql throught ODBC).
I have this macro to get query results, how to change it?
Thanks for help!

Code: Select all   Expand viewCollapse view
    dim rows
    rows = createUnoService("com.sun.star.sdb.RowSet")
    rows.ActiveConnection = oSubForm.ActiveConnection
    rows.CommandType = com.sun.star.sdb.CommandType.COMMAND
    rows.Command = "SELECT `OrderItemId`, `OrderItemNameOrder`, `OrderItemQuantity`, `OrderItemIDH`, `OrderItemPrice`, `OrderItemCurrency`, `CompanyId`, `OrderItemNo` FROM `OrderItem` WHERE `OrderItemId` = " & OrderItem
    rows.execute()
OOo 3.1.1 on Ubuntu 9.10
User avatar
kububa
 
Posts: 14
Joined: Mon Feb 25, 2008 3:01 pm

Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 8 guests