OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Does Rowset work with a MySQL database?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Machine Head
General User
General User


Joined: 07 Nov 2006
Posts: 6

PostPosted: Wed Oct 10, 2007 11:11 pm    Post subject: Does Rowset work with a MySQL database? Reply with quote

Hello,

I try to transfer my base databases to MySQL but I have some problems with my macros which worked before...


After having define my connexion with good parameters in the macro maConnexion, I can make some queries using SQL and I have access to the datas.
Code:
instrSQL = "SELECT * From arrachage"
maRequete = maConnexion.createStatement()
resuQuery = maRequete.executeQuery(instrSQL)


But when I want to use the rowset utility, I can't access to the same database, I have an error saying "the database arrachage doesn't exist"
Code:
unRowSet = createUnoService ("com.sun.star.sdb.Rowset")
With unRowSet
.activeConnection = maConnexion
.CommandType = com.sun.star.sdb.CommandType.TABLE
.Command = "arrachage"
.execute
End With


I use the JDBC driver to connect and the version of mysql is 4.1.1.15

Maybe that the rowset doesn't work with MySQL databases. What do you think about that problem?
Back to top
View user's profile Send private message
mobi-doc
OOo Enthusiast
OOo Enthusiast


Joined: 30 Jan 2007
Posts: 130
Location: Thessaloniki

PostPosted: Wed Oct 10, 2007 11:44 pm    Post subject: Reply with quote

I've worked before with rowsets and Mysql, but with ODBC driver, and had no problem.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Machine Head
General User
General User


Joined: 07 Nov 2006
Posts: 6

PostPosted: Thu Oct 11, 2007 12:10 am    Post subject: Reply with quote

I've found one solution: I modify these expressions
Code:

.CommandType = com.sun.star.sdb.CommandType.TABLE
.Command = "arrachage"

By this one
Code:

.CommandType = com.sun.star.sdb.CommandType.COMMAND
.Command = "SELECT * FROM arrachage"


And it's work!!!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group