Originally Posted by sriphp
i am trying to insert openoffice doc data in to mysql table from openOffice. for that i done
installed openOffice base on fedora
and opened my document in openOffice
(first i am testing to insert any text in mysql)
(i want to take mysql connection and select database)
oDBCntxt = CreateUnoService("com.sun.star.sdb.DatabaseContext")
oDBSrc = oDBCntxt.getByName( "newdb" ) //newdb is my database in mysql
oConnection = oDBSrc.getConnection("root","srinath")
oStatement = oConnection.CreateStatement
sSQL = sSQL & "insert into tblTest ( Id, data ) values( null, 'ddd' );"
now when i run that macro at tools ->macros -> run macros
i am getting error dialog like
An exception occurred
Either your MySQL database isn't created, the table IN the database isn't created, or you're having a problem with the data. You haven't posted any sample data, or any details about the table, so it's hard to say. The insert looks suspicious...inserting a null? And where is the 'ddd' value defined??
i don't know statements for reading my doc file here tell me how that also
please tell me how to solve this.
Don't know what you mean by this...do you mean how do you POST a part of your doc? Open the doc...copy some out...paste into the box, preferable with CODE tags around it.