Floppy File Errors
3 messages in this thread
I am writing a VB database application that uses the Get Statement to
randomly read a data file. I have defined a structure that is used to
fetch the data from each record. I have proceeded quite far in this
application and am now adding the "finishing touches," including
comprehensive error handling.
In the routine that reads records I have placed an On Error GoTo Statement
immediately before the Get Statement. If I use a floppy disk file, and
attempt to generate an error by opening the drive latch, VB does *not*
trigger an error. After executing the On Error Statement, the Get
Statement "accesses" the drive and the structure is filled with garbage.
Shouldn't the Get Statement trigger an error if the drive isn't ready? Has
anyone out there experienced this phenomenon and is there a work around?
Hi Kenny,
I tried a quick example similar to what you were stating. I was able to
duplicate and learn what VB is doing. WHen you are writting to disk, you
are actually writting to the Windows file buffer, to be written when Windows
determines the need. It will not generate an error until this buffer is
filled and windows tries to write to disk, or when you close your
file…whichever occurs first. In any event, you will still be able to trap
this error as you have and still handle it and retieve/store the information
you are wanting to retrieve/store. I could not get it to get any garbage.
One one instance, I opened a file that contained 5 records, opened the
drive, then retireved 10 records. It did not access the drive, but had
already buffered records into the buffer and displayed my 5 records, plus 5
more "empty" records. Can you duplicate this "garbage retireval"? If so
let me know how you duplicated it and I can look further.
Don Funk
There is 1 Reply.
Don,
Did I read your message right concerning Windows file handling? I
*thought* I had been told before that Windows left all file/disk handling
to DOS. As I read your note, Windows plays some role here also.
Apparently I missed something along the way. Where can I get more info on
the role Windows plays here? Are you sure the writing was to a Windows
file buffer and not to a DOS file buffer???
Dan