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

Why the ResultSet doesn't load all records in a SQL table?

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


Joined: 19 Nov 2006
Posts: 23

PostPosted: Sun Nov 19, 2006 3:40 am    Post subject: Why the ResultSet doesn't load all records in a SQL table? Reply with quote

Hello!
I'm trying to import data from a MySQL database in a Calc sheet using a macro; while doing this, the ResultSet that I create never contains all records that are in database's table and I don't know why. The code that I wrote is the following:

Dim DatabaseContext as Object
Dim DataSource as Object
Dim Connection As Object
Dim Statement As Object
Dim ResultSet As object
Const Costante1 = 1008
Const Costante2 = 1005

DatabaseContext = createUnoService("com.sun.star.sdb.DatabaseContext")

DataSource = createUnoService("com.sun.star.sdb.DataSource")
DataSource.SetPropertyValue("URL","sdbc:odbc:my_dsn_name")
DataSource.SetPropertyValue("User","extra")
DataSource.SetPropertyValue("Password","extra")
Connection = DataSource.getConnection("my_user","my_pwd")

Statement = Connection.createStatement()
Statement.ResultSetConcurrency = Costante1
Statement.ResultSetType = Costante2

ResultSet = Statement.executeQuery("select * from my_table_name")

The ResultSet created have always less rows than expected; the sintax should be correct and the problem is not in the max number of rows in the Statement because the problem remains even this value is changed. Also the connection works good. May it be a problem of compatibility between different versions of sofware? I'm using MySQL 4.0.15 and the macro builder included in OpenOffice 2.0.

If anyone can solve this problem I'll be very gratefull. Thanks a lot to everybody will help!
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