LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 06-02-2009, 02:07 AM   #1
sriphp
Member
 
Registered: Apr 2009
Posts: 48

Rep: Reputation: 15
insert openoffice data into mysql


Hai all,

This is sri

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

in tools ->macros -> organise macros -> OpenOffice.org Basic and for my document i created new macro 'mymac' and saved

mymac code
------------
(first i am testing to insert any text in mysql)
(i want to take mysql connection and select db)
Sub Main
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 = "insert into tblTest ( Id, data ) values( null, 'ddd' );"
oStatement.execute( sSQL)

End Sub

now when i run that macro at tools ->macros -> run macros
i am getting error dialog like

BASIC Error
An exception occurred
Type: com.sun.star.container.NoSuchElementException
Message: newdb

i don't know statements for reading my doc file here tell me how that also

please tell me how to solve this.

Thanks
Sri
 
Old 06-02-2009, 02:26 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread has been reported for closure because it is a duplicate.



http://www.linuxquestions.org/questi...-mysql-730059/
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
openOffice data into mysql sriphp Linux - Newbie 1 06-02-2009 04:42 PM
php/mysql data INSERT IGNORE problem frieza Programming 2 09-03-2008 03:42 PM
insert textbox in openoffice Four Linux - Newbie 4 03-23-2006 10:07 PM
segmentation fault when insert data into mysql torontosmallbird Other *NIX 1 08-07-2005 07:13 AM
Insert Data by FORM in MYSQL gruger Linux - Software 0 07-16-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration