Nov 11, 2003 #1 01310564 Programmer Oct 9, 2003 96 GB Is it posible to read a file in binary rather than text? Cheers, Hugh
Nov 11, 2003 #2 MrGreed Programmer Oct 3, 2002 284 US Function ReadBinaryFile(FileName) Const adTypeBinary = 1 'Create Stream object Dim BinaryStream Set BinaryStream = CreateObject("ADODB.Stream" 'Specify stream type - we want To get binary data. BinaryStream.Type = adTypeBinary 'Open the stream BinaryStream.Open 'Load the file data from disk To stream object BinaryStream.LoadFromFile FileName 'Open the stream And get binary data from the object ReadBinaryFile = BinaryStream.Read End Function For more info: http://www.pstruh.cz/tips/detpg_read-write-binary-files.htm MrGreed http://www.pastame.com "did you just say Minkey?, yes that's what I said." Upvote 0 Downvote
Function ReadBinaryFile(FileName) Const adTypeBinary = 1 'Create Stream object Dim BinaryStream Set BinaryStream = CreateObject("ADODB.Stream" 'Specify stream type - we want To get binary data. BinaryStream.Type = adTypeBinary 'Open the stream BinaryStream.Open 'Load the file data from disk To stream object BinaryStream.LoadFromFile FileName 'Open the stream And get binary data from the object ReadBinaryFile = BinaryStream.Read End Function For more info: http://www.pstruh.cz/tips/detpg_read-write-binary-files.htm MrGreed http://www.pastame.com "did you just say Minkey?, yes that's what I said."