detect database file size

Interesting. I've heard of 'short tons', and apparently incorrectly assumed 'tonne' was a localization of the word 'ton'.

A short ton is 2000 pounds. It came about from the descrepancy in the meaning of a "hundredweight" which is 112 pounds in the imperial system (can't have that pesky decimal scheme making things too logical) but only 100 pounds for others. Either way there are 20 hundredweight in a ton.

The 112 is probably derived from eight stones (there are fourteen pounds in a stone) in the same way a gallon is eight pints.
 
<< was a needles
<< was a needles qualifier.
<< was a needles qualifier.

pointing this out just because i've seen you do it a few times already... though i do get a giggle each time i see it ;)

needles = the sharp pointy thing that you can sew with (pron. nEE dills)
needless = when something is not needed (pron. nEEd less)

sorry to slow you down, moving right a long...
 
A short ton is 2000 pounds. It came about from the descrepancy in the meaning of a "hundredweight" which is 112 pounds in the imperial system (can't have that pesky decimal scheme making things too logical) but only 100 pounds for others. Either way there are 20 hundredweight in a ton.

The 112 is probably derived from eight stones (there are fourteen pounds in a stone) in the same way a gallon is eight pints.

(expletive) that for a joke. i'm glad i have to work with a decimal system!

not to mention the "same" US and UK/Oz measurements are different - you only have to open a cookbook from each to realise that. (e.g., US 1Tbps = 15 mL; UK 1Tbsp = 20 mL).

nomenclature and standardisation went out the window some time ago. it's basically each man for themselves these days :-/
 
Biologists, Chemists, Engineers, and various other fields all agree on that kilo-<whatever units of measurement> means exactly same thing in terms of magnitude even if the quantity being measured are not same thing.

hear, hear! (i'm a molecular microbiologist by trade ;))

Computer field is the only field that has acted like a willful jackass

...and culinary fields. refer to me previous post. very frustrating, let me tell you!
 
Ok guys, thank you very much for your inputs.

So was LOF or Filelen or filesystemobject were the only ways that we can get the value of db size correctly?
 
(expletive) that for a joke. i'm glad i have to work with a decimal system!

Australia went metric while I was at school. I had already learnt the Imperial system including chains, links (OMG it was 1/100 of a chain, how did they let that through :eek:), furlongs, rods, roods, perches, acres, bushells etc.

Then I had to learn metric and the conversion factors, many of which I still know by heart forty years later.

Also watch out for receipes from New Zealand. Despite being part of the Commowealth they use a US tablespoon.

My favourite mixed unit was encountered in Peru in 1994 where they expressed fuel consumption in kilometres per US gallon.:confused:
 
..and culinary fields. refer to me previous post. very frustrating, let me tell you!

To their credit, they didn't take in a kilogram and call it 12 lbs or something equally (or worse!) perverted.

With the various measurements, though... As inconsistent as they may, my armchair theory has been that they were more 'intuitive' units and easy to estimate by eye or such without precise tools available. But being an armchair theory, it's entirely my speculation backed by well, nothing. Would quite nicely explain how we got into that mess, I think.

My favourite mixed unit was encountered in Peru in 1994 where they expressed fuel consumption in kilometres per US gallon.:confused:

That's pretty messed up. :eek:
 
G’day Woy Woy.

I plead guilty on all points. :D
(Keyboard shopping list; 1 new Escape key for spinning avatars, 1 new F7 key for speling, speeling speelling…, trying to get it correct.)

Regards,
Chris.
 
Last edited:
>>Also watch out for recipes from New Zealand. Despite being part of the Commowealth they use a US tablespoon.<<

If they nicked it from a US hotel they must pass it around a lot. :D
 
AccessProgram

I’m not sure how many ways there are but does not LOF work correctly for your needs?
 
AccessProgram

Something to try: -

Code:
Option Explicit
Option Compare Text


Sub Test()
    Dim lngFileLength As Long
    
    On Error GoTo ErrorHandler
    
    lngFileLength = GetFileLength("C:\Access\PACJobs.mdb")
    
    If lngFileLength > -1 Then
        MsgBox lngFileLength
    Else
        MsgBox "Houston, we have a problem."
    End If

ExitProcedure:
    Exit Sub

ErrorHandler:
    MsgBox "Error Number     : " & err.Number & vbNewLine & _
           "Error Description: " & err.Description & vbNewLine & _
           "In Procedure      : Test()" & vbNewLine & vbNewLine & _
           "Houston, we have another problem."
            
    Resume ExitProcedure

End Sub



Public Function GetFileLength(ByVal strFullPathAndFileName As String) As Long
    Dim lngFileHandle As Long
    
    On Error GoTo ErrorHandler
    
    lngFileHandle = FreeFile()

    Open strFullPathAndFileName For Input As lngFileHandle
    GetFileLength = LOF(lngFileHandle)
    Close lngFileHandle

ExitProcedure:
    Exit Function

ErrorHandler:
    MsgBox "Error Number     : " & err.Number & vbNewLine & _
           "Error Description: " & err.Description & vbNewLine & _
           "In Procedure      : GetFileLength()"
           
    GetFileLength = -1
    Resume ExitProcedure

End Function
 
In a way, the code you provided was identical to mine.

When I test, Filelen, LOF and filesystemobject in getting the db size, their results were the same. So I can use either of the three.

I was just thinking if their where other functions that will state the correct db size because I am confused where what value is correct? Is the value indicated in the windows explorer correct or is the value extracted from LOF, filelen or filesystemobject is the correct value?

In reply to Dave, commenting that this question was silly. I dont know it this is silly but for in my case I have a purpose for this one, so I guess this is important question that I should ask help from the forum.
 
I was just thinking if their where other functions that will state the correct db size because I am confused where what value is correct? Is the value indicated in the windows explorer correct or is the value extracted from LOF, filelen or filesystemobject is the correct value?

They are all correct including Explorer.
Explorer displays kibibytes. That is 1024 bytes in a KB.

I guess you ignored the discussion about kibibytes (2^10) versus kilobytes (10^3). It might have seemed like we went off on a tangent but this is actually the crux of the difference.

(OK. Discussing Tablespoons and hundredweights did cross the line ;))
 
the UK (US) is replete with non metric measurements

avoirdupois/troy weights are, I am sure non metric
fluid measure pints/gallons etc are non metric

I am sure most of them refer to old practical measurement systems - cubits/hands/roods/perches/furlongs/chains/gills/pints/gallons etc
UK currency was non metric

metrication was a necessary corollary, I think to computerisation

This is why it didnt matter so much with distances, as these have fewer computer applications. We refer to decimal miles quite easily, but when we need a system that has "fractal" properties, if you will - then we HAVE to use Kilometres/metres/centimetres etc etc

It was probably just convenient that a 1000Kilos and 2240 pounds were rugly similar in weight, so people who used those measurements - ie road haulage/freight - could change from one systrem to the other with relatively modest impact.

Note that in the UK under the weights and measure it became illegal to sell in anything other than metric measurements - which produced the stupid packaging of butter, and similar in units of 227gms (ie 1/2 pound) and milk remained in true pints, as well as metric.

Interestingly in france, apparently they have always been accustomed to buy certain goods in livres (english pounds!, not books) - go figure.


And we are happy to mix systems in certain instances

I am 6', not 1.83
I am 12 stone 7 (I wish!) . but not 175lbs, and definitely not however many kilos
however I buy petrol in litres, but my car does 35mpg, not whatever litres/100K
 
Last edited:
Which is heavier; a pound of feathers or a pound of gold?
(Easy one to Google.)
 
Dear all


Well, (lower case) k have always meant 1000, it is a SI prefix, meaning 1000
http://en.wikipedia.org/wiki/SI_prefix

Therefore 1 kb/B have been, are and will always be 1000 bytes

If the industry do not want to mess it up even more then it should stick to SI prefix, that is,
1 kb = kilo bytes = 1000 bytes
1000 kb = Million bytes = 1 Mb = 1000 000 bytes
1000 Mb = Giga bytes = 1 Gb = 1000 000 000 bytes

Trying to use the SI units constructed for the decimal system onto a technical system
that is using octets and several octects that is using the binary number system
will only be confusing.

If the industry tries to introduce M for 1024 * 1024 octects
and G for 1024 * 1024 *1024, for example like this,

1 KB = 1024 octets
1 mB = 1024 * 1024 octects
1 gB = 1024 * 1 mB

Then we all will suffer again, people will still be confused,
who will notice/know the difference between a lowecase m and a uppercase M.

The only decent is to skip all prefix calculations based on 1024 and stick to SI prefix



Regards
 
Just to point something out-

Not many people realize there is an actual difference between a calorie and Calorie. The food label you read may report Calories, not calories, yet it's lost because everywhere else in the label many other words are capitalized so it seemed natural.

So it's not first time nor I suspect it will be the last time they conflate a convenient prefix to mean something else that it never really meant.
 
Which is heavier; a pound of feathers or a pound of gold?
(Easy one to Google.)

Googleanswer :p

The question is an old gag, based on the fact that gold is measured in troy ounces, but feathers (like all material other than precious metals and gemstones) are measured in avoirdupois ounces. Because troy weight has 12 ounces to a pound, but avoirdupois weight has 16 ounces to a pound, the trick answer is that a pound of feathers (at 16 ounces) is heavier than a pound of gold (at 12 ounces).

JR
 
I had dealings once with a guy named Troy Weight. Always wondered if he had a brother called Avoirdupois.
 

Users who are viewing this thread

Back
Top Bottom