Re: Re: Error message "No content provider available for URL!"
Ocke Janssen <[email protected]> Wed, 02 Dec 2009 07:26:34 +0100
| Newsgroups | gmane.comp.openoffice.dba.user |
|---|---|
| Organization | Sun Microsystems GmbH |
| Message-ID | <[email protected]> |
Hi Dick,
On 02.12.09 00:01, Dick Hoffman wrote:
> 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
This line
> DBaseName = "jdbc:hsqldb:file:\C:RahStuff\Base_Stuff\Cleve_CBC.odb"
should be
DBaseName = "file:///C:/RahStuff/Base_Stuff/Cleve_CBC.odb"
Best regards,
Ocke
> 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]
>
--
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
Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Thomas Schr?der, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Haering