C++ builder数据库的问题几个
1.如何将很长的text存入blob中。
2.如何按字节读出blob中的数据
3.如何对字节进行按位进行移位操作。
第一次用BCB请高手多指教!!!
[解决办法]
第一个问题使用TBlobStream
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TBlobStream *Stream1;
TStream *Stream2;
Stream1 = new TBlobStream(Table1Notes, bmRead);
try
{
ClientDataSet1-> Edit();
// here抯 another way to create a blob stream
Stream2 = ClientDataSet1-> CreateBlobStream(ClientDataSet1-> FieldByName( "Remarks "), bmReadWrite);
try
{
Stream2-> CopyFrom(Stream1, Stream1-> Size);
ClientDataSet1-> Post();
}
__finally
{
delete Stream2;
}
}
__finally
{
delete Stream1;
}
}
[解决办法]
第二个问题是逆否而已
先读出来 再对数据操作
第三个问题应该是同11111111或者00000000与操作
更加具体的要看书了
[解决办法]
第一个问题使用TBlobStream
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TBlobStream *Stream1;
TStream *Stream2;
Stream1 = new TBlobStream(Table1Notes, bmRead);
try
{
ClientDataSet1-> Edit();
// here抯 another way to create a blob stream
Stream2 = ClientDataSet1-> CreateBlobStream(ClientDataSet1-> FieldByName( "Remarks "), bmReadWrite);
try
{
Stream2-> CopyFrom(Stream1, Stream1-> Size);
ClientDataSet1-> Post();
}
__finally
{
delete Stream2;
}
}
__finally
{
delete Stream1;
}
}
第二个问题是逆否而已
先读出来 再对数据操作
第三个问题应该是同11111111或者00000000与操作
更加具体的要看书了