我想问以下,怎样在上指定的服务器的目录下生成的XML,我这里在本地指定的目录下能生成XML,
procedure TF_SJCX.BitBtn3Click(Sender: TObject); //在本地指点的根目录下生成XML,
procedure DSTODOM(RootName,RecordName:String;xmDoc:TXMLDocument;dataset:TDataSet);
var
iNode,Dxml,iChild,iAttribute:IXMLNode;
i,j:integer;
begin
dataset.open;
dataset.First;
//j:=dataset.RecordCount ;
xmdoc.DocumentElement :=xmdoc.CreateNode(RootName);
while not dataset.Eof do
begin
iNode:=xmDoc.DocumentElement.AddChild(recordName);
for i:=0 to dataset.FieldCount -1 do
begin
ichild:=iNode.AddChild(DataSet.Fields[i].FieldName );
ichild.Text:=dataset.Fields[i].AsString;
end;
dataset.Next;
end;
end;
VAR
xml1:TXMLDocument;
s,SourcePath:string;
begin
xml1:=TXMLDocument.Create(application);
xml1.Active:=FALSE;
xml1.XML.Text:='';
xml1.Active:=true;
DSTODOM('HistoryInOrOut','RECORD',xml1,data1.ADO_SJCX);
SourcePath := ExtractFileDir(Application.ExeName);
//取得应用程序路径
//if (StrLen(PChar(SourcePath)) <> 3) then
SourcePath := SourcePath + '\';
s := SourcePath + 'xml\' + formatdatetime('yyyymmdd',date);
xml1.SaveToFile(s+'.xml');
end;
这些程序什么改,
SourcePath := ExtractFileDir(Application.ExeName);
//取得应用程序路径
//if (StrLen(PChar(SourcePath)) <> 3) then
SourcePath := SourcePath + '\';
s := SourcePath + 'xml\' + formatdatetime('yyyymmdd',date);
xml1.SaveToFile(s+'.xml');
procedure TF_SJCX.BitBtn3Click(Sender: TObject); //在本地指点的根目录下生成XML,
procedure DSTODOM(RootName,RecordName:String;xmDoc:TXMLDocument;dataset:TDataSet);
var
iNode,Dxml,iChild,iAttribute:IXMLNode;
i,j:integer;
begin
dataset.open;
dataset.First;
//j:=dataset.RecordCount ;
xmdoc.DocumentElement :=xmdoc.CreateNode(RootName);
while not dataset.Eof do
begin
iNode:=xmDoc.DocumentElement.AddChild(recordName);
for i:=0 to dataset.FieldCount -1 do
begin
ichild:=iNode.AddChild(DataSet.Fields[i].FieldName );
ichild.Text:=dataset.Fields[i].AsString;
end;
dataset.Next;
end;
end;
VAR
xml1:TXMLDocument;
s,SourcePath:string;
begin
xml1:=TXMLDocument.Create(application);
xml1.Active:=FALSE;
xml1.XML.Text:='';
xml1.Active:=true;
DSTODOM('HistoryInOrOut','RECORD',xml1,data1.ADO_SJCX);
SourcePath := ExtractFileDir(Application.ExeName);
//取得应用程序路径
//if (StrLen(PChar(SourcePath)) <> 3) then
SourcePath := SourcePath + '\';
s := SourcePath + 'xml\' + formatdatetime('yyyymmdd',date);
xml1.SaveToFile(s+'.xml');
end;
这些程序什么改,
SourcePath := ExtractFileDir(Application.ExeName);
//取得应用程序路径
//if (StrLen(PChar(SourcePath)) <> 3) then
SourcePath := SourcePath + '\';
s := SourcePath + 'xml\' + formatdatetime('yyyymmdd',date);
xml1.SaveToFile(s+'.xml');
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货