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

Connection read-only after opening through OOo Basic

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
shivisi
General User
General User


Joined: 09 Oct 2005
Posts: 36

PostPosted: Thu Dec 08, 2005 5:52 am    Post subject: Connection read-only after opening through OOo Basic Reply with quote

When I use SB to open a stored connection with the SetConnection procedure in the following module:
Module name - modConnection
Code:
Option Explicit
Global Connection As Object

Function SetConnection()
Connection=createUnoService("com.sun.star.sdb.DatabaseContext").getByName("TestFlatFileFunctions").GetConnection("","")
End Function

Function ClearConnection()
Connection.close
Connection=Nothing
End Function

I cannot make changes to the objects in the objects of the stored connection, even after running ClearConnection (the other procedure in the module, designed to release the connection). I have to close the quickstarter and any running OOo components, and open OOo again.

What can I do to get around this?
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Thu Dec 08, 2005 1:49 pm    Post subject: Reply with quote

Very interesting... what happens if you get the connection based on the URL of the Base document rather than by the registered datasource name? What if the document is NOT registered?
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
shivisi
General User
General User


Joined: 09 Oct 2005
Posts: 36

PostPosted: Fri Dec 09, 2005 1:18 am    Post subject: Reply with quote

Quote:
what happens if you get the connection based on the URL of the Base document rather than by the registered datasource name?

If I connect using the URL, I am able to change the design.
Quote:
What if the document is NOT registered?

How can I access the data source if it's not registered, other than by the URL?
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Fri Dec 09, 2005 10:31 am    Post subject: Reply with quote

If I understand you correctly, you are saying that if you use the URL rather than the registered name, then you have no problems.

Near as I can figure, you have two, and only two options; using the registered name, or using the URL. Well, this is not entirely true. If the Base document references external data such as a Calc document or address book, then you can connet directly...

what happens if you do NOT close the connection to your registered data source? Do things work? what happens if you write a loop and connect to it say 100 times? 100,000 times? I am looking for resource leaks. Do the memory requirements grow? Does it eventually fail? If not, then use your registered data source and do not close the connection.

Ultimately, you may want to ask on the dev@dba.openoffice.org mailing list.
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1453
Location: France

PostPosted: Sat Dec 10, 2005 6:29 am    Post subject: Reply with quote

shivisi :
Try this
Code:
Function ClearConnection()
Connection.close
Connection.dispose
End Function

_________________
Bernard

OpenOffice.org 1.1.5 fr / Apache OpenOffice 4.0.1 / LibreOffice 4.1.0
MS-Windows 7 Home SP1
This forum is spammed, use instead Apache OpenOffice forums
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base 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