Attempting to write a Basic macro that issues a Base query and produces some statistics from the result set. I am getting a runtime error message saying 'No content provider available for URL!' Any advice on what I'm doing wrong here would be appreciated. The statements in question are the following with the error related to the "DataSource" statement:

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)    '<===== error msg
Connection = DataSource.GetConnection("","")
Statement = Connection.createStatement()
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 database exists and contains data.
Dick


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

Reply via email to