Storages & Files RecordCount property
RecordCount property (read/write)

When read this property returns the total count of the records in the stream. They are calculated over the current stream size, the size of the record (calculated by the filter) and the beginning of the stream - as set in the filter (see the SFFIlter.StreamBegin).

When written the property sets the stream size to the number of records specified (SFFIlter.StreamBegin takes effect also). Therefore setting RecordCount to a number less than the current actual record count will truncate the stream. Respectively setting it to a greater value will extend the stream.

Can be called only if the record has been previously bound to a stream.

Syntax:

variable = record_object.RecordCount

record_object.RecordCount = variable

Parameters:

variable - numeric (long integer) - the number of records in the stream.

Examples:

Set rec = Server.CreateObject("newObjects.utilctls.SFRecord")
Set main = Server.CreateObject("newObjects.utilctls.SFMain")
Set file = main.OpenFile("Somefile.bin")
rec.AddField "FirstName", vbString, 20
rec.AddField "LastName", vbString, 20
rec.BindTo file
Response.Write "The file contains " & rec.RecordCount & " records"

Remarks:

The RecordCount property gets/sets the number of the records in the stream calculated over the stream size without the reserved part of the stream. The reserved part of the stream is the first n bytes - as specified in the SFFilter's StreamBegin property. Its default value is 0 therefore by default the Record count is the stream_size/record_size. Pay attention to the SFFilter's role - depending on the filter and its settings the record size (i.e. the physical size of the record in the stream) will be different - for example the strings may be saved/read as ANSI or UNICODE and this will result in different physical representations.

Applies to: SFRecord object

See also: SFFilter

Supported on:

Windows 95/NT and later
Windows CE 3.0 and later
Pocket PC/Windows Mobile 2003 and later
Windows CE.NET 4 and later

 

newObjects Copyright 2001-2006 newObjects [ ]