访问Oracle数据库中含为BLOB字段数据时,有的表会出现错误,有的表不会。
要正常访问Oracle数据库的BLOB字段数据是否需要进行某些设置?
如何进行设置?执行(MT为 BLOB字段类型)
sSql:='select MT from SDDA_MEDIA where ID='1';
ClientDataSet.Close;
ClientDataSet.CommandText:=sSql;
ClientDataSet.Open; --这里出错
(ClientDataSe.FieldByName('PHOTO') as TBlobField).SaveToStream(pPicture.photoStream);
jpg.LoadFromStream(pPicture.photoStream);
AImage.Picture.Assign(jpg);
在弹出的对话框中出现如下错误信息。
‘project sdgis.exe raised exception class EOleException with message 'Data type
if not supported'. process stopped.use step Run to continue.’
但执行(PHOTO 为 BLOB字段类型)
sSql:='select PHOTO from PDDA_10JD2 where JDBH='1';
ClientDataSet.Close;
ClientDataSet.CommandText:=sSql;
ClientDataSet.Open;
(ClientDataSe.FieldByName('PHOTO') as TBlobField).SaveToStream(pPicture.photoStream);
jpg.LoadFromStream(pPicture.photoStream);
AImage.Picture.Assign(jpg);
一切正常。
执行以上的操作使用相同的连接,相同的TClientDataSet TSocketConnection。
要正常访问Oracle数据库的BLOB字段数据是否需要进行某些设置?
如何进行设置?执行(MT为 BLOB字段类型)
sSql:='select MT from SDDA_MEDIA where ID='1';
ClientDataSet.Close;
ClientDataSet.CommandText:=sSql;
ClientDataSet.Open; --这里出错
(ClientDataSe.FieldByName('PHOTO') as TBlobField).SaveToStream(pPicture.photoStream);
jpg.LoadFromStream(pPicture.photoStream);
AImage.Picture.Assign(jpg);
在弹出的对话框中出现如下错误信息。
‘project sdgis.exe raised exception class EOleException with message 'Data type
if not supported'. process stopped.use step Run to continue.’
但执行(PHOTO 为 BLOB字段类型)
sSql:='select PHOTO from PDDA_10JD2 where JDBH='1';
ClientDataSet.Close;
ClientDataSet.CommandText:=sSql;
ClientDataSet.Open;
(ClientDataSe.FieldByName('PHOTO') as TBlobField).SaveToStream(pPicture.photoStream);
jpg.LoadFromStream(pPicture.photoStream);
AImage.Picture.Assign(jpg);
一切正常。
执行以上的操作使用相同的连接,相同的TClientDataSet TSocketConnection。
如果PHOTO为空或者
一切正常。
由此可见 TClientDataSet TSocketConnection 三层结构
好像不支持 BLOB类型的数据
不知这个问题 如何解决
CDS访问LOB字段数据是沒問題的,
一般, 你說出錯, 可能有null值引起的