7.2.5.2 x64 windows10
Latest version seems nice. But my SQL calls through DatabaseContext now all fail.
I have been using this just fine for months…
function DoSQL(strSQL as string) as variant
Dim Context as object, DataSource as object, Conn as object, Stmt as object, myType as string
if NOT(globalLibreActivationdone) then exit function
if len(strSQL) < 1 then exit function
on error goto handle
Context=CreateUnoService(“com.sun.star.sdb.DatabaseContext”) '< get the database context
DataSource = Context.getByName(“MyDataBase”) REM resolve system name for database as it resides in system stucture
Conn=DataSource.getConnection("","") REM acquire an active connection (username & password pair - HSQL default blank)
Stmt=Conn.createStatement()
if instr(strSQL,“Q*”) >0 then
strSQL = mid(strSQL,3)
say(“Doing Special QUERY:” & strSQL)
DoSQL = Stmt.executequery(strSQL) '<- run the SQL command
else
say(“RUNNING SQL:” & strSQL)
DoSQL = Stmt.executeupdate(strSQL) '<- run the SQL command
endif
DoSQL= Error
Conn.close() '<- close the db connection
exit function
handle:
DoSQL = Error 'return error information
if err <> 1 then say(“Problem in DoSql:” & err & chr(13) & Error)
end function
But now it does not find my database in the context.getbyname line. And all of my SQL fails completely. Has the structure of this linkage changed with this newest version?