MATLAB: Does MATLAB crash when I run EXEC on a closed database connection using the Database Toolbox 3.0.2 (R14SP2)

Database Toolbox

I am using the Database Toolbox and experience a crash when I run EXEC on a closed database connection:
conn=database('myDSN','','')
curs=exec(conn,'SELECT ALL productNumber FROM inventoryTable')
curs=fetch(curs)
close(curs)
close(conn)
curs=exec(conn,'SELECT ALL productNumber FROM inventoryTable')

Best Answer

There is a bug in the Database Toolbox 3.0.2 (R14SP2) in the way that EXEC handles a closed connection. To work around this issue, change line 27 of EXEC.M from:
if ~(isempty(class(connect.Handle)))
to:
if isconnection(connect)
You can do this by typing:
edit exec
Related Question