Hello Andrew,

> I am so close, I can smell it, but it does not work. Any comments on the 
> steps that I am missing... I think that I need to set default keys and 
> that sort of thing...
> 
> The following macro tries to create a databsae document...

Which part of your macro is alerady working, and which isn't?

I'd suggest something along those lines:

' create a new DB document
oDBContext = createUnoService( "com.sun.star.sdb.DatabaseContext" )
oDB = oDBContext.createInstance();
oDB.URL = "sdbc:embedded:hsqldb"
oDB.storeAsURL( ConvertToURL( "C:\OODB\Address01.odb" ) )
  ' storing is important. Before you do any real work with the
  ' DB, store it. Else, lot of operations won't work as expected.

' connect
oConnection = oDoc.getConnection( "", "" )

' get the tables
oTables = oDoc.getConnection().getTables
' create a new table
...

' clean up
oConnection.close()
  ' note that this will implicitly flush any possibly pending
  ' changes you did

' store the document
oDB.store()


Note that a major difference here is that I used the DatabaseContext to
create a new DB document. Such docs to not appear in a frame. If you
need to see the document, you should use your version with the
loadComponentFromURL.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer,  OpenOffice.org Database Access -
- [EMAIL PROTECTED]                  http://dba.openoffice.org -
-                                                                     -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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

Reply via email to