LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 05:29 AM   #1
sriphp
Member
 
Registered: Apr 2009
Posts: 48

Rep: Reputation: 15
connect mysql from openOffice


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

Sub Main
sUser$ = "root"
sPass$ = "srinath"

Dim oParms(2) as new com.sun.star.beans.PropertyValue
oParms(0).Name = "user"
oParms(0).Value = sUser
oParms(1).Name = "password"
oParms(1).Value = sPass
oParms(2).Name = "JavaDriverClass"
oParms(2).Value = "com.mysql.jdbc.Driver"

sURL$ = "sdbc:mysql:jdbc:localhost:3306/newdb"
oDBCntxt = CreateUnoService("com.sun.star.sdbc.DriverManager")


AppendProperty(oParms(), "JavaDriverClass", "com.mysql.jdbc.Driver")
oCon = oManager.getConnectionWithInfo(sURL, oParms())

oStatement = oCon.CreateStatement



sSQL = "insert into tblTest ( Id, data ) values( null, 'ddd' );"
oStatement.execute( sSQL)

End Sub

when i run this macro i am getting error dialog as

BASIC run time error
Object variable not set.
at oCon = oManager.getConnectionWithInfo(sURL, oParms()) line.

please tell me solution for this

Thanks
Sri

Last edited by sriphp; 06-02-2009 at 05:37 AM. Reason: correction
 
Old 06-02-2009, 04:53 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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-730060/
http://www.linuxquestions.org/questi...-mysql-730059/
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
How to connect OpenOffice to Mysql cjagdish69 Linux - Software 1 05-25-2007 06:41 AM
LXer: Connect OpenOffice.org to MySQL LXer Syndicated Linux News 0 02-24-2007 10:46 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

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

All times are GMT -5. The time now is 06:06 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration