Hi All.
I have a Calc file with macros using Mysql connector that worked perfectly previously but I have upgraded to Libreoffice 7.3.7.2 from Libreoffice 6
the error message is as follows
BASIC runtime error.
An exception occurred
Type:com.sun.star.lang.DisposedException
Message:./connectivity/source/drivers/mysql/mysql_driver.cxx:128
I have looked around the search engines and come up with very little in the way of results
Macro.
sub charges ''' bring in a list of current charges
Sheet8 = ThisComponent.Sheets.getbyname("admin")
''' make contact with MYSQL server '''
rem Run an SQL command on a table in LibreOffice Base
Context = CreateUnoService("com.sun.star.sdb.DatabaseContext")
rem URL of database (it is also possible to use a registered DB name)
DATABASE_NAME = "file:///home/user/myfile.odb"
Db = Context.getByName(DATABASE_NAME)
rem connect to the database
Conn = Db.getConnection("user","passwd")
rem create statement object
Stmt = Conn.createStatement()
''' get hour rate
strSQL1 = "SELECT Hour_rate from Charge_rates where record = 1 "
oResult = Stmt.executequery(strSQL1)
oResult.next
outputvalue = oResult.getstring(1)
Sheet8.getCellRangeByName("M6").setvalue outputvalue
‘’’ get fuel charge
strSQL2 = "SELECT Fuel_rate from Charge_rates where record = 1 "
oResult = Stmt.executequery(strSQL2)
oResult.next
outputvalue = oResult.getstring(1)
Sheet8.getCellRangeByName(“M5”).setvalue outputvalue
end sub
the number at the end of the message (128) is that an error code?
Many thanks. Neil