I'm having trouble comparing 2 binary files, can anyone give me a pointer to what I'm doing wrong in the following function:
Any help would be greatly appreciated!
Code:
private function filesSame(FileName1, FileName2)
Const adTypeBinary = 1
'Create Stream objects
Dim BinaryStream1, BinaryStream2
Set BinaryStream1 = CreateObject("ADODB.Stream")
Set BinaryStream2 = CreateObject("ADODB.Stream")
'Specify stream type - we want To get binary data.
BinaryStream1.Type = adTypeBinary
BinaryStream2.Type = adTypeBinary
'Open the stream
BinaryStream1.Open
BinaryStream2.Open
'Load the file data from disk To stream object
BinaryStream1.LoadFromFile FileName1
BinaryStream2.LoadFromFile FileName2
'Open the stream And get binary data from the object
BinaryFile1 = BinaryStream1.Read
BinaryFile2 = BinaryStream2.Read
if BinaryFile1 <> BinaryFile2 then
filesSame = false
else
filesSame = true
end if
end function
Any help would be greatly appreciated!