VB 2008 - Bad Record Length
Hi there,
I'm getting an error message when I try and save record data to a file.
The error message I recieve says 'Bad Record Length', and highlights the following code - FilePut(filenum, customer)
1. Can someone please explain to me what the error message means?
2. Can anyone suggest a way to rectify it?
Thanks
Re: VB 2008 - Bad Record Length
Don't use FilePut. That's a VB6 holdover. You're using VB.NET so you should use it. Do file I/O using members of the System.IO namespace. If you explain what you're actually trying to achieve then we can suggest the best way to achieve it.
Re: VB 2008 - Bad Record Length
Sorry for the delayed reply.
Basically, We have a structure set up, which holds some customer data - name, dob, address, deposit etc.
We then write to a file (Random Access, as this was the tutorial followed)
After much investigation, it appears that there is a limit on the number of bytes allowed? IS this right? if so, is there a way of extending the size? Or a quick add-on to allow it to work?
Re: VB 2008 - Bad Record Length
I've never used FilePut and no VB.NET developer ever should. I don't know what limitations it has but they shouldn't be an issue. If you must use it then I can't be of help. If you don't have to use it then don't. Use a FileStream or a BinaryWriter. Even if you must use FilePut, you should ask your teacher why VB.NET has been around for almost 10 years and they are still teaching the VB6 way of doing things.