Hi everyone...this is my problem: If I start the application with a -db C:\\mydb.db option and mydb.db isn't a valid fly by night services database file (for example an ASCII file), the Data class does: nFields = db.readInt(); description = new FieldInfo[nfields]; the value of nFields is absolutely wrong, because it contains a large integer value, so when it tries to dim the array description, it throws an OutOfMemoryError! How I can achieve this behaviour?? I suppose is incorrect to insert in my code a try {} catch (OutOfMemoryError) { } Thanks...
Some of us added a rudimentary integrity check to our startup code that would prevent this from happening if you opened up other files by mistake. There's another thread that discusses it, but I couldn't find it. Anyway, the code is like this:
Thanks Pete, but... you can't write in your code if(headerLen < 0 || nFields != 9 || recordCount < 1) because in this way you will able to manage a datasource with only 9 field (future enhancements...). The structure of your database is hard-coded and I think it is not very well... Thanks anyway...