在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
delphi OleVariant转换RecordSet uses Data.Win.ADODB; function varToRecordSet( parms : OleVariant ) : Data.Win.ADODB._Recordset; begin Result := IDispatch( parms ) as Data.Win.ADODB._Recordset; end; function RecordSetToVar( prs : _Recordset ) : OleVariant; begin Result := prs; end;
function recordSetToXMLString(prs:winapi.ADOInt._Recordset): string; var astr:string; stream:TStringStream; begin stream := TStringStream.Create(''); prs.Save(TStreamAdapter.Create(stream) as IUnknown,adPersistXML); stream.Position:=0; astr:=stream.DataString; stream.Free; Result := astr; end; function xmlStringToRecordSet(pxml:string): _Recordset; var drs:Data.Win.ADODB._Recordset; irs:winapi.ADOInt._Recordset; RS: Variant; stream:TStringStream; begin stream := TStringStream.Create(pxml); stream.Position:=0; RS := CreateOleObject('ADODB.Recordset'); RS.Open(TStreamAdapter.Create(stream) as IUnknown); Result := IUnknown(RS) as winapi.ADOInt._Recordset; end;
ids: IDispatch; ADODataSet1.Recordset := ids as _Recordset; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论