New API tools to keep users away from or Tables

Fernand Vanrie <[email protected]> Wed, 16 Feb 2011 15:33:27 +0100
Newsgroups gmane.comp.openoffice.dba.devel
Message-ID <[email protected]>
--------------070900050004020403020104
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Sinds 3.3.0 we got some new tools to keep or users away from the 
database tables.

Using OO as a front end for a SQL server  is made far more easy now.  If 
we want to use the data-source browser to use data from a SQL table then 
there was no other way than Registering a OO-Database-file with a "user" 
who have some rights on the SQL server. Problem was that the user rights 
stayed open as long OO was not been closed.
Now we can do better

    oDBcontext = CreateUnoService("com.sun.star.sdb.DatabaseContext")

    if not oDBcontext.hasbyname("mysql_OOdatabase")then
    oDB.registerDatabaseLocation("mysql_OOdatabase","MyDBfilelocation")
    endif

 >> here we can  use the OOdatabase

   oConn = 
oDBcontext.GetByName("mysql_native_PMG_reports").GetConnection("username","SQLpasword") 


   oDBcontext.revokeobject( "mysql_OOdatabase"

Thanks for this new tools

Fernand

--------------070900050004020403020104--