symbian 数据库字段长度

来源:互联网 发布:mac程序管理器怎么打开 编辑:程序博客网 时间:2024/05/22 14:36

 

 TDbCol(const TDesC& aName,TDbColType aType); 

 TDbCol(const TDesC& aName,TDbColType aType,TInt aMaxLength); 

 

 

  EDbColText  : 默认长度  50, 自定义长度  aMaxLength

  EDbColLongText :基本不限制长度,但需要用流读写,如:

 

 

 

void CDBColStream::WriteStream( RDbTable& atable, TDbColNo aCol, const TDesC& adescription )

{

RDbColWriteStream writeStream;

    writeStream.OpenLC(atable,aCol);

writeStream.WriteL(adescription);

writeStream.Close();

CleanupStack::Pop();

}

 

void CDBColStream::ReadStream( RDbTable& atable, TDbColNo aCol, HBufC* description )

{

TInt length = atable.ColLength(aCol);

RDbColReadStream readStream; 

readStream.OpenLC(atable,aCol);

TPtr16 temp(description->Des());

readStream.ReadL(temp,length);

 

readStream.Close();

CleanupStack::Pop(); //readStream

}

 

原创粉丝点击