Venkat wrote:
> Hi,
>
> I've explored MSDN thoroughly, unfortunately, I could not find any useful
> information.
> Please help me by providing some other resources.
> Please.
Lets think about this...
The 'signature' you were given earlier is actually the first n number of
bytes in an MDB file... This same count of bytes needs to be altered
in some way so that your file can reliably be altered in both directions
(from and back to a valid MDB) so as to provide some means of protecting
your information or your methods...
so...
Open the real MDB... I suggest using Binary file access ala:
Dim ff as integer: ff = freefile(0)
Open "FileName1" for Binary as #ff
Open a new blank file:
Dim ff2 as integer: ff2 = freefile(0)
Open "FileName2" for Binary as #ff2
Read in all the bytes of the file.
Dim s() as byte
Redim s(0 to lof(ff)-1 as byte
get #ff,, S
Now, you may alter them in any way you please, but I might recommend a
simple XOR
Dim i as long
For i = 0 to 9
s(i) = s(i) Xor 255
Next
Write out the altered MDB to the recieving file...
put #ff2,,S
Close the file handles
Close #ff : Close #ff2
The reverse operation is very similar...
Open the Altered MDB:
Dim ff as integer: ff = freefile(0)
Open "FileName2" for Binary as #ff
Open a new blank file:
Dim ff2 as integer: ff2 = freefile(0)
Open "FileName1" for Binary as #ff2
the rest should remain the same...
hth,
D.
>> Stay informed about: Backup and restore feature on VB6 application