我用ado+access编化工企业的仓库管理系统
因为化工企业大多以公斤为单位,故数量一般不能用整数,应该要用有小数点的实数
1、我这个数量在access应设为什么类型?(access中的数字类型:整型,长整型,单精度,双精度,同步复制ID,小数)
2、单价在access应设为什么类型?
3,delphi中的strtofloat后的实数在access的数字类型中应该属于那一个?

解决方案 »

  1.   

    按照你的说法;
    1、数量后一般也就两位小数;应该用单精度吧;2、单价也可以用单精度;3、函数strtofloat后的实数不分单精度和双精度;自动判断;跟你在数据库中定义的数据类型无关;
      

  2.   

    1,2可以用float就可以了
    strtofloat函数你可以参见下面:
    Use StrToFloat to convert astring, S, to a floating-point value. S must consist of an optional sign (+ or -), a string of digits with an optional decimal point, and an optional mantissa. The mantissa consists of 'E' or 'e' followed by an optional sign (+ or -) and a whole number. Leading and trailing blanks are ignored.The DecimalSeparator global variable defines the character that must be used as a decimal point. Thousand separators and currency symbols are not allowed in the string. If S doesn't contain a valid value, StrToFloat raises an EConvertError exception.