What database system are you using? Also what do you mean by not access. You can query the rceords in a file using OPENROWSET in SQL Server. In your case you could just do a
select RecordCount from OPENROWSET(‘MICROSOFT.JET.OLEDB.4.0′,’Text;Database=R:\YOURFILELOCATION\;HDR=No’, ‘SELECT count(*) AS RecordCount FROM YOURFILENAME.CSV’)
This will return the number of rows. This probably exists in whatever database server you are using.
You can get an approximation of the number of records using the record size, blocksize, number of tracks/cylinders of disk space.
You might also want to verify if all the records are the same size or variable (if variable, then use an average size minimum-size + maximum size. divided by 2)
1) Determine the record size (such as 80 bytes/record)
2) Divide this value into the blocksize (such as 3200 / 80 = 40) to determine the number of records per block
3) Determine the number of blocks per disk cyclinder (such as 20 blocks / cylinder)
4) Determine the number of cylinders used by this file (such as 30 cylinders)
The resulting number of records should be:
3200 / 80 = 40 (records/block)
40 * 20 (blocks/cylinder) = 800 records/cylinder
800 * 20 (cyl) = 16000 records (approx).
This should be fairly accurate, the only issue is the number of records in the last block, which can range from 1 record to 40 records (15,961 minimum number)