<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Hi Frank,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I suspect you're right. Try something like
the following:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="COLOR: blue">Structure</SPAN> Person<?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: blue">Public</SPAN> ID <SPAN
style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">Integer<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: blue">Public</SPAN> MonthlySalary <SPAN
style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">Decimal<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: blue">Public</SPAN> LastReviewDate <SPAN
style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">Date<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><VBFixedString(15)> <SPAN style="COLOR: blue">Public</SPAN>
FirstName <SPAN style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">String<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><VBFixedString(15)> <SPAN style="COLOR: blue">Public</SPAN>
LastName <SPAN style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">String<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><VBFixedString(15)> <SPAN style="COLOR: blue">Public</SPAN> Title
<SPAN style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">String<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes">
</SPAN><VBFixedString(150)> <SPAN style="COLOR: blue">Public</SPAN>
ReviewComments <SPAN style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">String<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: EN-AU"><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="COLOR: blue">End</SPAN> <SPAN
style="COLOR: blue">Structure</SPAN></SPAN><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></P>
<P>The key element is the <VBFixedString(x)> (not the Public). I
have a working example if that would help.</P>
<P>-Alex Hopkins, Bayside Christian College</FONT></P>
<P><FONT face=Arial size=2></FONT> </P></DIV>
<DIV><FONT face=Arial size=2>----- Original Message ----- </FONT>
<DIV><FONT face=Arial size=2>From: "Frank Van Den Boom" <</FONT><A
href="mailto:vandenboomfj@aquinas.vic.edu.au"><FONT face=Arial
size=2>vandenboomfj@aquinas.vic.edu.au</FONT></A><FONT face=Arial
size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>To: <</FONT><A
href="mailto:is@edulists.com.au"><FONT face=Arial
size=2>is@edulists.com.au</FONT></A><FONT face=Arial size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>Sent: Monday, July 24, 2006 4:05 PM</FONT></DIV>
<DIV><FONT face=Arial size=2>Subject: [Year 12 Its] VB.NET record
structure/random access file question</FONT></DIV></DIV>
<DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV><FONT face=Arial
size=2>> In my conversion from VB6 to VB.NET, I have hit a snag in the area
of<BR>> random access file processing.<BR>> <BR>> Here is what I
am trying to do:<BR>> - create a record structure which has a mixture of
field data types eg<BR>> Structure CDType<BR>> Dim ID As Short<BR>> Dim
Title As String<BR>> Dim Artist As String<BR>> Dim price As
Decimal<BR>> End Structure<BR>> - Assuming variable 'CD' is of type
'CDType, then open the file for<BR>> random access.<BR>> FileOpen(1,
filename, OpenMode.Random, , , Len(onecd))<BR>> - The program crashes ('bad
record length') when I write new records to<BR>> the (using Fileput), where
the string fields are longer than one<BR>> character.<BR>> <BR>> What
is really weird about this, is that it does not happen for all<BR>> users,
which made me think it was security related. But PC's are all<BR>> ghosted
with same setup, so I have put that possible cause on the<BR>> sideline for
now.<BR>> <BR>> I think the problem arises because of the way the String
fields are<BR>> declared in the record structure.<BR>> <BR>> In VB6,
'bad record length' also arose in this situation and it was<BR>> essential
that String variables be followed by the number of characters<BR>> to
allocate to that field. Eg.<BR>> Structure CDType<BR>> Dim ID As
Short<BR>> Dim Title As String * 15<BR>> Dim Artist As String * 10<BR>>
Dim price As Decimal<BR>> End Structure<BR>> <BR>> And given the
nature of random file processing, that made plenty of<BR>> sense to me.
Unless it assumed that everyone string was 255 characters,<BR>> how else
could it determine record length. However that VB6 syntax is<BR>> not
accepted in VB.NET, and I have searched high and low for its<BR>> successor
without success.<BR>> <BR>> Any ideas out there?<BR>> Frank<BR>>
<BR>> _______________________________________________<BR>> </FONT><A
href="http://www.edulists.com.au"><FONT face=Arial
size=2>http://www.edulists.com.au</FONT></A><BR><FONT face=Arial size=2>> IT
Systems Mailing List kindly supported by<BR>> </FONT><A
href="http://www.vcaa.vic.edu.au"><FONT face=Arial
size=2>http://www.vcaa.vic.edu.au</FONT></A><FONT face=Arial size=2> - Victorian
Curriculum and Assessment Authority and<BR>> </FONT><A
href="http://www.vitta.org.au"><FONT face=Arial
size=2>http://www.vitta.org.au</FONT></A><FONT face=Arial size=2> - VITTA
Victorian Information Technology Teachers Association Inc</FONT></BODY></HTML>