How to retrieve "Database Used (KB)" information?

Is it possible to retrieve “Database Used (KB)” information (which is normally displayed in Database Info dialog) within C/AL? How to do it?

No, you cannot, all you can do is retrieve the size of the database. Declare Database File as a variable of type record. and do a DatabaseFile.FIND(’-’); then check the value for the field “Size KB”

Thank you Tarek however this will not help me much. What I would like to do is to give administrator a warning when the “Database Used %” ratio reaches 90% limit or so. I tried to count the total of “BLOB size” from “Object” table, add total of “Size (KB)” from “Table Information” table, but the value I received this way was LARGER than the one displayed in the standard dialog box (File, Database, Information). (I tried it with demo database, and the difference was cca 10 - 15%).

If you look at Table 2000000028 Table information. This gives you the size of each table, so you can just add these together and get a guestimate of how much of the database has been used. Paul Baxter

I did that. However “2000000028 Table Information” table contains information only about tables (as such), I think. Therefore I added to this value the size of other objects from “2000000001 Object” table: VAR _Occupied: Integer; _Table: Record “Table Information”; _Object: Record Object; _Occupied := 0; IF _Table.FIND(’-’) THEN REPEAT _Occupied := _Occupied + _Table.“Size (KB)”; UNTIL _Table.NEXT = 0; IF _Object.FIND(’-’) THEN REPEAT IF _Object.Type <> _Object.Type::Table THEN _Occupied := _Occupied + ROUND((_Object.“BLOB Size” / 1024),1); UNTIL _Object.NEXT = 0; MESSAGE('Occupied size: ’ + ‘FORMAT(_Occupied) + ’ KB’); When I suppose that “Table Information”.“Size (KB)” represents amount of space occupied by both data and (table) object definition (as shown in the code above), I receive “better” results. However I still miss something. For example with my demo database, this codeunit reports 24192 KB occupied, compared to 23832 KB displayed in standard NF Database Info dialog.