procedure TForm1.Button1Click(Sender: TObject);
var
path:string;
ws:integer;
FList: TStringList;
ws1:string;
neirong:string;
begin
ws:=0;
path:='C:\2.txt';
//self.ADOConnection1.Connected:=False;
//self.ADOConnection1.ConnectionString:='Provider=MSDASQL.1;Persist Security Info=False;'+
// 'Data Source=study;Extended Properties="DSN=study;DBQ='+
// path+'study;DefaultDir='+path+';DriverId=790;FIL=excel 8.0;'+
// 'MaxBufferSize=2048;PageTimeout=5;";Initial Catalog='+path+'study';
self.ADOConnection1.Connected:=True; self.ADOQuery1.Close;
self.ADOQuery1.Connection:=self.ADOConnection1;
Self.ADOQuery1.SQL.Clear;
self.ADOQuery1.SQL.Add('select * from [ws$]');
self.ADOQuery1.Open;
self.ADOQuery1.first;
while not adoquery1.Eof do
begin
ws1:=adoquery1.fieldbyname('Thickness').AsString;
adoquery1.Next;
if ws1='16' then
begin
FList:= TStringList.Create;
FList.add(neirong);
end;
end;
FList.SaveToFile(path);
edit1.Text:=inttostr(ws);
end;
我想把excel表中的数据保存到记事本中 为什么记事本中是空的。
var
path:string;
ws:integer;
FList: TStringList;
ws1:string;
neirong:string;
begin
ws:=0;
path:='C:\2.txt';
//self.ADOConnection1.Connected:=False;
//self.ADOConnection1.ConnectionString:='Provider=MSDASQL.1;Persist Security Info=False;'+
// 'Data Source=study;Extended Properties="DSN=study;DBQ='+
// path+'study;DefaultDir='+path+';DriverId=790;FIL=excel 8.0;'+
// 'MaxBufferSize=2048;PageTimeout=5;";Initial Catalog='+path+'study';
self.ADOConnection1.Connected:=True; self.ADOQuery1.Close;
self.ADOQuery1.Connection:=self.ADOConnection1;
Self.ADOQuery1.SQL.Clear;
self.ADOQuery1.SQL.Add('select * from [ws$]');
self.ADOQuery1.Open;
self.ADOQuery1.first;
while not adoquery1.Eof do
begin
ws1:=adoquery1.fieldbyname('Thickness').AsString;
adoquery1.Next;
if ws1='16' then
begin
FList:= TStringList.Create;
FList.add(neirong);
end;
end;
FList.SaveToFile(path);
edit1.Text:=inttostr(ws);
end;
我想把excel表中的数据保存到记事本中 为什么记事本中是空的。
解决方案 »
- 新手求助!!!关于Delphi编程问题。
- 如何在FORM一启动SHOW的时候,就触发FORM上的一个控件的执行?
- 关于Delphi深度探索-活动目录开发
- 关于IDTCPServer和IDTCPClient数据传输
- DBGRID的栏目顺序如何保存
- 如何屏蔽stringgrid中的方向键
- 让一个文本框的内容等于一个下拉列表的索引值的代码怎么写?
- 请帮忙看看下面程序后面的[1]是什么意思??
- 请问为什么许多第三方PAGECONTROL控件不能象DELPHI自带的那个那样DOCK了?
- 关于端口侦听的问题
- 100%菜求DELPHI2009下载地址
- idhttp如何登陆 带 froms 验证 的aspx ?
procedure TForm1.Button1Click(Sender: TObject);
var
path:string;
ws:integer;
FList: TStringList;
ws1:string;
neirong:string;
begin
ws:=0;
path:='C:\2.txt';
//self.ADOConnection1.Connected:=False;
//self.ADOConnection1.ConnectionString:='Provider=MSDASQL.1;Persist Security Info=False;'+
// 'Data Source=study;Extended Properties="DSN=study;DBQ='+
// path+'study;DefaultDir='+path+';DriverId=790;FIL=excel 8.0;'+
// 'MaxBufferSize=2048;PageTimeout=5;";Initial Catalog='+path+'study';
self.ADOConnection1.Connected:=True; self.ADOQuery1.Close;
self.ADOQuery1.Connection:=self.ADOConnection1;
Self.ADOQuery1.SQL.Clear;
self.ADOQuery1.SQL.Add('select * from [ws$]');
self.ADOQuery1.Open;
//self.ADOQuery1.first;
FList:= TStringList.Create;{-------------------------------------这里}
while not adoquery1.Eof do
begin
ws1:=adoquery1.fieldbyname('Thickness').AsString;
if ws1='16' then
begin
FList.add(neirong);
end;
adoquery1.Next;{-------------------------------------------------这里}
end;
FList.SaveToFile(path);
edit1.Text:=inttostr(ws);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
path:string;
ws:integer;
FList: TStringList;
ws1:string;
neirong:string;
begin
ws:=0;
path:='C:\2.txt';
//self.ADOConnection1.Connected:=False;
//self.ADOConnection1.ConnectionString:='Provider=MSDASQL.1;Persist Security Info=False;'+
// 'Data Source=study;Extended Properties="DSN=study;DBQ='+
// path+'study;DefaultDir='+path+';DriverId=790;FIL=excel 8.0;'+
// 'MaxBufferSize=2048;PageTimeout=5;";Initial Catalog='+path+'study';
self.ADOConnection1.Connected:=True; self.ADOQuery1.Close;
self.ADOQuery1.Connection:=self.ADOConnection1;
Self.ADOQuery1.SQL.Clear;
self.ADOQuery1.SQL.Add('select * from [ws$]');
self.ADOQuery1.Open;
//self.ADOQuery1.first;
FList:= TStringList.Create;
while not adoquery1.Eof do
begin
ws1:=adoquery1.fieldbyname('Thickness').AsString;
if ws1='16' then
begin
FList.add(neirong);
end;
adoquery1.Next;
end;
FList.SaveToFile(path);
edit1.Text:=inttostr(ws);
end;