Hi Ray,

first of all the odb file is a zip package where the whole database stuff is inside the folder database. That's the good news ;-) If the data inside is corrupted they may be gone. You could try to extract the files and prefix them with e.g. test. So you can access them as you access a server hsqldb. For the BeanShell I didn't test it myself, but could it be that the BeanShell uses his own classpath variable which is different to the one used by OOo. You may have a look at $(user)/config/javasettings_Windows_x86.xml in my case.

Best regards,

Ocke

Ray Jahn wrote:
Thank you for response.  I desparately need to regain access to my *.odb data.
The explanation follows.  Thanks.  Ray

 -----

abbreviation: OO = OpenOffice

reference:
www.oooforum.org/forum/viewtopic.phtml?t=41997
  Macro-Calc-Base, OO Basic code to connect from OO Calc to OO Base
  author: Drew Jensen

I was trying to duplicate in OO BeanShell the Calc to Base connection
as demonstrated by Drew Jensen in OO Basic.
I do not remember the exact details as OO BeanShell does not debug info.
The effort involves the following set of OO BeanShell statements,
in part and in full as I progressed through the trial.

-- HSQLDB JDBC driver from OpenOffice
-- sdbc_hsqldb.jar
-- com.sun.star.sdbcx.*

oDatabase = CreateUnoService("com.sun.star.sdb.DatabaseContext")
cnct = oDatabase.GetByName( "an OO registered DB" ).GetConnection( "sa", "" )
stmt = cnct.createStatement() rslt = stmt.executeQuery( sql_string )

// print( rslt.getMetaData() );
// print( rslt.getString( col_name_string ) );

rslt.close();
stmt.close();
cnct.close();

I have previously successfully connected from within stand alone BeanShell to
a stand alone HSQLDB, using the following statements.

-- HSQLDB JDBC driver from www.hsqldb.org
-- hsqldb.jar
-- org.hsqldb.jdbcDriver

// BeanShell commands based on BeanShell own classloader and classpath 
management
// addClassPath() getClassPath() getClass()
addClassPath( "d:/hsqldb/lib/hsqldb 1.8.0.5.jar" );

import org.hsqldb.*;  // org.hsqldb.jdbcDriver, etc.
import java.sql.*;    // DriverManager Connection Statement ResultSet

Class.forName( "org.hsqldb.jdbcDriver" ).newInstance();
print( Collections.list( DriverManager.getDrivers() ) );

Connection cnct;
Statement  stmt;
ResultSet  rslt;

cnct = DriverManager.getConnection( "jdbc:hsqldb:file:d:/tmp base/test", "sa", 
"" );
// the remaining codes are very similar to those in OO BeanShell

One possibile culprit might be code mix-up during copy and paste.
It can be driver definition, can be classpath, etc.

It seems that OO maintains certain connection state info.
in global variables for entire OO,
not just for individual connection sessions.
Failure or mistakes of one connection session can affect the entire OO Base,
if this guess is correct.


________________________________________
PeoplePC Online
A better way to Internet
http://www.peoplepc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Ocke Janssen                      Tel: +49 40 23646 661, x66661
Dipl. Inf(FH)                     Fax: +49 40 23646 550
Sun Microsystems Inc.
Nagelsweg 55                     mailto:[EMAIL PROTECTED]
D-20097 Hamburg                   http://www.sun.com/staroffice

Example isn't another way to teach, it is the only way to teach. Albert Einstein

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to