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

database read-only (*.lck-file) problem

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


Joined: 08 May 2007
Posts: 12

PostPosted: Wed May 20, 2009 5:07 am    Post subject: database read-only (*.lck-file) problem Reply with quote

Hi,
Im using the following code to get results from a database. Al works well, until the database was stored on a networkdrive. Each time someone runs this routine, a *.lck file was created preventing others to open the file as well.

How can i prevent creating a lck-file (or open the database read-only?)

Code:
sub selectstatement (sDatabaseName as string, sTableName as string, sQuery as String)
   'Variablen declareren
   dim odatabaseContext as object
   dim oDatasource as object
   dim oConnection as object
   dim oStatement as object
   
   ' get database
   odatabaseContext = createUnoService("com.sun.star.sdb.DatabaseContext")
   oDatasource = odatabaseContext.getByName(sDatabaseName)
   oConnection = oDatasource.getConnection("", "")
   oStatement = oConnection.createStatement()
   
   ' execute query
   oResultSet = oStatement.executeQuery(sQuery)
end sub
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Wed May 20, 2009 6:19 am    Post subject: Reply with quote

Hello

OOo-base in the standard configuration is not multiuser. It seem to me that you use it with more users.

Romke
Back to top
View user's profile Send private message
gercokees
General User
General User


Joined: 08 May 2007
Posts: 12

PostPosted: Wed May 20, 2009 7:16 am    Post subject: Reply with quote

so what do you suggest?
I just like to edit the file with one single user, but read the file with many users.
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Wed May 20, 2009 9:04 am    Post subject: Reply with quote

Hello

When you want use your database with more users at the same time then you cannot work with a database who is embedded in your database.odb file. You must have a database engine who can work as server for all users. There are several database engines who you can use: MySQL, HSQLDB and more. The database.odb must be on all the computers where you use it. Maybe it can from a network.


I'm a home user and cannot tell much more.
On this forum there several posts who explain it more by: Villeroy and Keme.

http://user.services.openoffice.org/en/forum/viewtopic.php?f=13&t=16848

I hope this help a little

Romke
Back to top
View user's profile Send private message
gercokees
General User
General User


Joined: 08 May 2007
Posts: 12

PostPosted: Thu May 21, 2009 2:07 am    Post subject: Reply with quote

oke, i understand now, thanx a lot...
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