
Program fragments in Access 2.0 mdb files
schreibt:
Quote:
>Now folks, I know Access 2.0 and VB 3.0 is old stuff, but I really don't
>want my source code{*filter*} on to the end of an .mdb file!
Such effects occur with any program, that extend files by writing to specific
offsets far behind the current EOF. Something like VB:
Open ... for Binary As hFile
Put hFile, 1000000, anything
In this case, the system extends the file, by allocating currently unused
sectors (or clusters) from disk. But as long as no other data is written to
that area, the original contents of the disk sectors are preserved.
In VB this should never occur (untested), either an error should be reported,
or the file should be extended by writing the appropriate amount of zero bytes.
But using API functions, it will be possible to create such effects.
If you want to avoid such problems, as far as possible, you can write a small
program, that creates a file and writes zeroes to it, until "disk full" is
reported. Then close and kill that file. Now all unused sectors are filled with
zeroes, or whatever pattern you have written to that file. Then you can create
and fill a new data base, that cannot contain fragments of your code in it. But
as soon as you make changes to your code, VB kills the old sources, and then
the contents of these files may again become visible in the database, after the
next update.
Best you use different partitions for your source files and the database, then
your source code can never become part of the database, since partitions never
share the same physical disk space.
DoDi