| View previous topic :: View next topic |
| Author |
Message |
shivisi General User

Joined: 09 Oct 2005 Posts: 36
|
Posted: Thu Dec 08, 2005 5:52 am Post subject: Connection read-only after opening through OOo Basic |
|
|
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 |
|
 |
pitonyak Administrator


Joined: 09 Mar 2004 Posts: 3618 Location: Columbus, Ohio, USA
|
Posted: Thu Dec 08, 2005 1:49 pm Post subject: |
|
|
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 |
|
 |
shivisi General User

Joined: 09 Oct 2005 Posts: 36
|
Posted: Fri Dec 09, 2005 1:18 am Post subject: |
|
|
| 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 |
|
 |
pitonyak Administrator


Joined: 09 Mar 2004 Posts: 3618 Location: Columbus, Ohio, USA
|
Posted: Fri Dec 09, 2005 10:31 am Post subject: |
|
|
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 |
|
 |
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Sat Dec 10, 2005 6:29 am Post subject: |
|
|
shivisi :
Try this | Code: | Function ClearConnection()
Connection.close
Connection.dispose
End Function |
_________________ Bernard
OpenOffice.org 1.1.5 fr / OpenOffice.org 3.4.1 en-US + langpacks, MS-Windows XP Home SP3
This forum is unusable, use instead Apache OpenOffice forums |
|
| Back to top |
|
 |
|