2005-04-26 03:24:42 UTC
DEPO0.31 connects to sybase ASA8.0,In delphi, i define a variable sname,whose datatype is string. in ASA, i have a table,whose name is toil. as follows:
tfybill = class(TInterfacedPersistent)
private
fsname: shortstring;
ficode: integer;
public
property sname: shortstring read fsname write fsname ;
property icode: integer read ficode write ficode ;
end;
...
with DBMapping1.Classes.Add do
begin
ClassObject := tfyBill;
StorageName := 'toil';
OnNewObjectId := fmfymain.NewId;
with AttributesMapping.Add do
begin
AttributeName := 'icode';
ColumnName := 'fcode';
Size := 0;
IndexType := idxNone;
IsOID := True;
end;
with AttributesMapping.Add do
begin
AttributeName := 'sname';
ColumnName := 'fname';
Size := 10;
IndexType := idxNone;
IsOID := False;
end;
...
now there comes a problem,the DEPO can translate the attribute 'icode' to the table's column 'fcode' correctly,but it can't do with attribute 'sname'. when sname='love depo', the column of fname can only get 'l',that is : fname='l',it just translate the first character of 'love depo' to the column 'fname' of table .how to resolve this problem? help me...plz..