Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upgrade of VB6 programs to VB.Net

Status
Not open for further replies.

Ken01

Programmer
Aug 8, 2014
54
0
6
GB
Hello All
I have been trying to upgrade some VB6 programs which use random/relative file access into Vb.Net 2008.

Although there are equivalent code statements I encounter the error 'Unable to read beyond end of stream'.

Has anyone any ideas?
 

Could you post the code that produces the error?

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Hi Thanks for replying. This is the relevant code :

FileOpen(2, "c:\vbas\Equation.rdf", OpenMode.Random, , , RecordLength:=Len(fqrec))
rpos = 1
FileGet(2, fqrec, rpos) ***** THIS LINE GIVES ERROR ****
While Not EOF(2) ' check if already exists
ListBox1.Items.Add(fqrec.fqval1 & " " & fqrec.fqval2 & " " & fqrec.fycor3 & " " & fqrec.fycor5 & " " & fqrec.fycor7 & " " & fqrec.fycor11)
rpos = rpos + 1
FileGet(2, fqrec, rpos)
End While

===================================================================================================================

Variable fqrec along with its sub-variables is defined in the Modules section.

This works perfectly in VB6.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top