access的数字型和货币型为何用Table1.Fields[i].DataType取出来都是ftfloat???
我想把货币型改为Currency型,在程序中该如何做???

解决方案 »

  1.   

    ftfloat就是real
    给你他的类型说明吧,你自己看是对应到delphi什么类型啦Value DescriptionftUnknown       Unknown or undetermined
    ftString       Character or string field
    ftSmallint     16-bit integer field
    ftInteger       32-bit integer field
    ftWord       16-bit unsigned integer field
    ftBoolean       Boolean field
    ftFloat       Floating-point numeric field
    ftCurrency Money field
    ftBCD       Binary-Coded Decimal field
    ftDate       Date field
    ftTime       Time field
    ftDateTime Date and time field
    ftBytes        Fixed number of bytes (binary storage)
    ftVarBytes Variable number of bytes (binary storage)ftAutoInc        Auto-incrementing 32-bit integer counter field
    ftBlob       Binary Large OBject field
    ftMemo       Text memo field
    ftGraphic    Bitmap field
    ftFmtMemo        Formatted text memo field
    ftParadoxOle Paradox OLE field
    ftDBaseOle dBASE OLE field
    ftTypedBinary Typed binary field
    ftCursor           Output cursor from an Oracle stored procedure (TParam only)
    ftFixedChar Fixed character field
    ftWideString Wide string field
    ftLargeint Large integer field
    ftADT        Abstract Data Type fieldftArray         field
    ftReference REF field
    ftDataSet   DataSet field
    ftOraBlob  BLOB fields in Oracle 8 tables
    ftOraClob          CLOB fields in Oracle 8 tables
    ftVariant   Data of unknown or undetermined type
    ftInterface References to interfaces (IUnknown)
    ftIDispatch References to IDispatch interfaces
    ftGuid         globally unique identifier (GUID) values
      

  2.   

    dataset.fieldbyname('ddd').asCurrency:=12.22
      

  3.   

    我的程序是这样写的:
    if Table1.Fields[i].DataType=ftFloat then TrFieType:='float';
    if Table1.Fields[i].DataType=ftCurrency then TrFieType:='Currency';
    TmpQry.Sql.Add('Alter Table x ADD zz '+TrFieType);数字型和货币型用Table1.Fields[i].DataType取出来都是ftfloat,可我想把货币型和数字型区分开。
      

  4.   

    if Table1.Fields[i].DataType=ftFloat then TrFieType:='float';
    if Table1.Fields[i].DataType=ftCurrency then TrFieType:='Currency';
    TmpQry.Sql.Add('Alter Table x ADD zz '+TrFieType);
      

  5.   

    不用Table1.Fields[i].DataType用别的方法可以实现吗?
      

  6.   

    我记得好像实现过你的用法!
    用adodataset数据库 sql server 7,定义的数据类型为Currency
    你试一下!