Data file (Binary) problems with no apparent cause

Mark__M used Ask the Experts™
I'm working on a project for company that needs to keep a tight lock on it's data and also asked that I do it in vb5 or vb6. I have used vb5.

I am experiencing intermitent data corruption using  a UDT to move the type to my .bas file to process the information, and  the traditional Put# and Get# methods for file I/O.

The variable Declarations are Dim'ed properly.
and  any data passed is an  Integer to keep the 2 byte record length at the Languages specified length.

But the data file when viewed is sometimes corrupted, correct, and now showing a 4 byte length for the record length.

I have kept to MS vb5 standards and double  checked myself by
making sure I updated to service pack 3, then researched this through VB 3, 5 Programmers Guide, VB 3, 5 Waite Superbible and multiple web sites.

I believe that my problem may not be coding but a problem with the Language itself.
Please advise
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2012
Difficult to hazard a guess.  Try posting the relevant code.

Observing ...

Top Expert 2012

Now that is really asinine.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial