Attached is my small test project, but unfortunately, that even throws an error before the "interesting part": Access violation reading... in line 46 of tdbhelper. Don't know, what's going wrong here, it works in my main program.
If it runs, you should be able to reproduce the error by "open" -> "close" -> "open" buttons...
--Dietmar