S
start_abc
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);<br>var<br> selectsql,FieldName:string;<br>begin<br> FieldName:='d:/aaa.xls';<br> SelectSQL:='Insert into [TABLE1] (a,b,c)' ; <br> SelectSQL:=SelectSQL+'select * FROM OpenDataSource( ' ;<br> SelectSQL:=SelectSQL+QuotedStr('Microsoft.Jet.OLEDB.4.0')+',' ;<br> SelectSQL:=SelectSQL+QuotedStr('Data Source="'+FieldName+'";Extended Properties=excel 8.0')+')...[Sheet1$]';<br> try<br> ADoc1.Execute(SelectSQL);<br> showmessage('成功!');<br> except<br> showmessage('失败');<br> end; <br>end;<br>本地excel 文件导入本地SQL服务器用上面的代码成功(adoc1 连接本地SQL服务器),<br>但是<br>导入远程SQL服务器时便出错(adoc1 连接远程SQL服务器),不知为什么?