我需要将参数作为SQL Server中存储过程的表值传递.如何在Delphi中处理这个? 可从 http://msftdpprodsamples.codeplex.com/wikipage?title=SS2008%21Readme_Table-Valued%20Parameters下载的样本用C语言编写,但可以很
将代码翻译成Delphi后,可以使用以下内容通过良好的ADO ADO访问结果集:
SourcesRecordset := CreateADOObject(CLASS_Recordset) as _Recordset; RSCon := SourcesRecordset as ADORecordsetConstruction; RSCon.Rowset := rowset; LDataSet := TADODataSet.Create(nil); try // Only doing the first result set LDataSet.Recordset := SourcesRecordset; while not LDataSet.Eof do begin //... something LDataSet.Next; end; finally LDataSet.Free; end;
请注意,CreateADOObject是Data.Win.ADODB.pas中的私有函数,但它非常简单.