Macros/Base/ba002

From The Document Foundation Wiki
< Macros‎ | Base
Jump to: navigation, search

Template:TopMenu/en Template:Menu/en Template:Menu.Macros/en

Other languages:

Description

Execute update in current database

Basic code

 1 Sub main()
 2     doc = ThisComponent
 3     conn = doc.DataSource.getConnection("", "")
 4 
 5     sql = "UPDATE ""contactos"" SET ""numbers""=TRIM(""numbers"")"
 6     cursor = conn.prepareStatement(sql)
 7     result = cursor.executeUpdate()
 8     doc.store()
 9     MsgBox result
10 End Sub