针对ACCESS数据库  在delphi5 中定义可以 但delphi6 中不行,请问如何修改才能在delphi6中编译通过arrMDBTypes: array[TFieldType] of Integer{Byte} =    ({dbText} 10 {ftUnknown},
     {dbText} 10 {ftString},
     {dbInteger} 3{2} {ftSmallint},
     {dbLong} 4 {ftInteger},
     {dbInteger} 3 {ftWord},
     {dbBoolean} 1 {ftBoolean},
     {dbDouble} 7 {ftFloat},
     {dbCurrency} 5 {ftCurrency},
     {dbDouble} 7 {ftBCD},
     {dbDate} 8 {ftDate},
     {dbTime} 8{22} {ftTime},
     {dbDate} 8 {ftDateTime},
     {dbLongBinary} 11 {ftBytes},
     {dbLongBinary} 11 {ftVarBytes},
     {dbInteger} 3 {ftAutoInc},
     {dbLongBinary} 11 {ftBlob},
     {dbMemo} 12 {ftMemo},
     {dbLongBinary} 11 {ftGraphic},
     {dbMemo} 12 {ftFmtMemo},
     {dbLongBinary} 11 {ftParadoxOle},
     {dbLongBinary} 11 {ftDBaseOle},
     {dbBinary} 9 {ftTypedBinary},
     {dbText} 10 {ftCursor}
    {$IFDEF VER120}
     ,
     {dbText} 10 {ftFixedChar},
     {dbText} 10 {ftWideString},
     {dbBigInt} 16 {ftLargeint},
     {dbText} 10 {ftADT},
     {dbText} 10 {ftArray},
     {dbText} 10 {ftReference},
     {dbText} 10 {ftDataSet}
    {$ELSE}
    {$IFDEF VER125}
     ,
     {dbText} 10 {ftFixedChar},
     {dbText} 10 {ftWideString},
     {dbBigInt} 16 {ftLargeint},
     {dbText} 10 {ftADT},
     {dbText} 10 {ftArray},
     {dbText} 10 {ftReference},
     {dbText} 10 {ftDataSet}    {$ELSE}
    {$IFDEF VER130}
     ,
     {dbText} 10 {ftFixedChar},
     {dbText} 10 {ftWideString},
     {dbBigInt} 16 {ftLargeint},
     {dbText} 10 {ftADT},
     {dbText} 10 {ftArray},
     {dbText} 10 {ftReference},
     {dbText} 10 {ftDataSet},
     {dbLongBinary} 11 {ftOraBlob},
     {dbLongBinary} 11 {ftOraClob},
     {dbText} 10 {ftVariant},
     {dbText} 10 {ftInterface},
     {dbText} 10 {ftIDispatch},
     {dbGUID} 15 {ftGuid}
    {$ENDIF}
    {$ENDIF}
    {$ENDIF}
    );

解决方案 »

  1.   

    var
       {$DEFINE VER120}
        arrMDBTypes: array[TFieldType] of Integer{Byte} =    ({dbText} 10 {ftUnknown},
         {dbText} 10 {ftString},
         {dbInteger} 3{2} {ftSmallint},
         {dbLong} 4 {ftInteger},
         {dbInteger} 3 {ftWord},
         {dbBoolean} 1 {ftBoolean},
         {dbDouble} 7 {ftFloat},
         {dbCurrency} 5 {ftCurrency},
         {dbDouble} 7 {ftBCD},
         {dbDate} 8 {ftDate},
         {dbTime} 8{22} {ftTime},
         {dbDate} 8 {ftDateTime},
         {dbLongBinary} 11 {ftBytes},
         {dbLongBinary} 11 {ftVarBytes},
         {dbInteger} 3 {ftAutoInc},
         {dbLongBinary} 11 {ftBlob},
         {dbMemo} 12 {ftMemo},
         {dbLongBinary} 11 {ftGraphic},
         {dbMemo} 12 {ftFmtMemo},
         {dbLongBinary} 11 {ftParadoxOle},
         {dbLongBinary} 11 {ftDBaseOle},
         {dbBinary} 9 {ftTypedBinary},
         {dbText} 10 {ftCursor}
         {$IFDEF VER120}
         ,
         {dbText} 10 {ftFixedChar},
         {dbText} 10 {ftWideString},
         {dbBigInt} 16 {ftLargeint},
         {dbText} 10 {ftADT},
         {dbText} 10 {ftArray},
         {dbText} 10 {ftReference},
         {dbText} 10 {ftDataSet}
         {$ELSE}
         {$IFDEF VER125}
         ,
         {dbText} 10 {ftFixedChar},
         {dbText} 10 {ftWideString},
         {dbBigInt} 16 {ftLargeint},
         {dbText} 10 {ftADT},
         {dbText} 10 {ftArray},
         {dbText} 10 {ftReference},
         {dbText} 10 {ftDataSet}     {$ELSE}
         {$IFDEF VER130}
         ,
         {dbText} 10 {ftFixedChar},
         {dbText} 10 {ftWideString},
         {dbBigInt} 16 {ftLargeint},
         {dbText} 10 {ftADT},
         {dbText} 10 {ftArray},
         {dbText} 10 {ftReference},
         {dbText} 10 {ftDataSet}
         {$ENDIF}
         {$ENDIF}
         {$ENDIF},
         {dbLongBinary} 11 {ftOraBlob},
         {dbLongBinary} 11 {ftOraClob},
         {dbText} 10 {ftVariant},
         {dbText} 10 {ftInterface},
         {dbText} 10 {ftIDispatch},
         {dbGUID} 15 {ftGuid},
         2, 
         3
         );
     delphi5没有试验过。
    1 注意{$ENDIF}的位置。
    2 还有数组项数必须和TFieldType定义的数目相同,如加入2,3两项后相等。
    3 {$DEFINE VERxxx }要在这定义数组前预定义一次。在程序中再次使用时再修改定义{$DEFINE VER130}.....