Server 端:
SoapDataModule中加入 ADOConnection1、ADODataSet1、DataSetProvider1;DataSetProvider1的DataSet设置为ADODataSet1;ADODataSet1的CommandText设置为空,Connection设置为ADOConnection1。
DataSetProvider1的DataRequest事件:procedure TDataMod.SoapDataModuleCreate(Sender: TObject);
var
DataPath: string;
const
SQL :string = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\programs\Delphi7\Demos\WebServices\SOAPDataModule\Data\Tree.mdb;Persist Security Info=False';
begin
DataPath := ExtractFilePath(Application.ExeName)+ '..\Data\';
XMLTransformProvider1.XMLDataFile := DataPath + 'XML_Document.xml';
XMLTransformProvider1.TransformRead.TransformationFile := DataPath + 'ToDp.xtr';
XMLTransformProvider1.TransformWrite.TransformationFile := DataPath + 'ToXml.xtr';
try
ADOConnection1.Connected :=false;
ADOConnection1.ConnectionString:= SQL;
ADOConnection1.Connected :=true;
except
//showmessage(A_ParentPath+'Data\InfoMat.mdb 调用失败');
end;
end;
Client端:
SoapConnection1、ClientDataSet1;ClientDataSet1的ConnectionBroker属性为SoapConnection1,ProviderName属性为DataSetProvider1
查询记录集:本文地址:http://com.8s8s.com/it/it4966.htm