Has anyone taken care of the case where a user would try to open the wrong type of db file( ie .bat or .xls ). There is no default handling of this in the Data file and the results are undefined. Travis
Hi Travis, Why give a user the option to open the wrong file type? Since we already know the name of the database (ie db.db) why not simply use that given to "idiot-proof" the database bootstrap code? For remote mode, the database should probably be in the same directory as the server and for local mode in the same directory as the client. By doing it that way you remove any chance of selecting an invalid file. You simply start the database without any user input. That's my opinion anyway Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
I think you need to allow the user to launch the server with the database file s/he wiches to use. In case the user enters the wrong database name, the data file will fail to open resulting in an exception which should be handled and dumped properly on the screen where the user tried to launch the server from.
Joined: Mar 06, 2002
Yes, the exceptions should be caught. However, any number of exceptions could be thrown, in any number of places. This will not neccessarily happen on the open but most likely some part of the read. I was only curious if anyone had come up with a graceful and simple way of handling them all. Travis