Frank Schoenheit, Sun Microsystems Germany wrote:
Hi Dick,

I've established a database with two tables that appears to be working
very well. I'm trying to write a Basic macro that issues a query and
generates some statistics from the results. I'm getting a runtime error
that says "No content provider available for URL!" Any idea what I'm
doing wrong?

This sounds as if you're trying to establish a connection to some
file-based database, i.e. your connection URL starts with something like
sdbc:dbase: or sdbc:flat:, and the URL after that prefix is wrong.

Ciao
Frank

Here are the statements in question. The database was created using OOo Base and does exist as "C:\RahStuff\Base_Stuff\Cleve_CBC.odb".

Dim DatabaseContext
Dim DataSource
Dim Connection
Dim Statement
Dim ResultSet
Dim sSQL as String
Dim DBaseName as String
DBaseName = "jdbc:hsqldb:file:\C:RahStuff\Base_Stuff\Cleve_CBC.odb"
DatabaseContext = createUnoService("com.sun.star.sdb.DatabaseContext")
DataSource = DatabaseContext.getByName(DBaseName)
Connection = DataSource.GetConnection("","")
Statement = Connection.createStatement()
' Following query gets all data records in ascending date within CBC species number order sSQL = "SELECT " & "ABA_NAMES.COMMON_NAME, CBC_DATA_RECS.COUNT_YR, CBC_DATA_RECS.SPECIES_COUNT" &_
" FROM CBC_DATA_RECS AS CBC_DATA_RECS, ABA_NAMES AS ABA_NAMES" &_
" WHERE CBC_DATA_RECS.SPEC_NO = ABA_NAMES.CBC_S_NUM" & " ORDER BY CBC_DATA_RECS.SPEC_NO ASC, CBC_DATA_RECS.COUNT_YR ASC"
ResultSet = Statement.executeQuery(sSQL)

The error occurs on the "DataSource" statement. The full error msg says:

BASIC runtime error
An exception occurred
Type: com.sun.star.lang.WrappedTargetException
Message: jdbc:hsqldb:file:\C:RahStuff\Base_Stuff\Cleve_CBC.odb
TargetException:
 Type: com.sun.star.ucb.ContentCreationException
 Message: No Content Provider available for given URL!

Dick


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to