数字内容可以正常显示,而带字符却无法显示,如果是中文,错误则更严重,根本无法运行。连接代码:
procedure TForm1.BitBtn1Click(Sender: TObject);
Var
FileNameVar : String;
begin
OpenDialog1.Execute;
NameVar := OpenDialog1.FileName;
ADOConnection1.ConnectionString := '';
ADOConnection1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source= '+''''+FileNameVar+''''+';Extended Properties=Excel 8.0;Persist Security Info=False';
ADOConnection1.Connected := True; ADOTable1.Open;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
Var
FileNameVar : String;
begin
OpenDialog1.Execute;
NameVar := OpenDialog1.FileName;
ADOConnection1.ConnectionString := '';
ADOConnection1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source= '+''''+FileNameVar+''''+';Extended Properties=Excel 8.0;Persist Security Info=False';
ADOConnection1.Connected := True; ADOTable1.Open;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货