L
lifangchao2008
Unregistered / Unconfirmed
GUEST, unregistred user!
下面是我向SQL中导入Excel的代码,在本地运行正常!<br>而要是向远程服务器中就不可用了,请大家帮忙解决以下!非常感谢!<br> With DM.ADOHQTDS do<br> begin<br> Close;<br> SQL.Clear;<br> SQL.Add('if exists (select * from dbo.sysobjects where id = object_id(N''[dbo].[导出表_Temp]'') and OBJECTPROPERTY(id, N''IsUserTable'') = 1)');<br> SQL.Add('drop table [dbo].[导出表_Temp]');<br> SQL.Add('SELECT * INTO 导出表_Temp FROM');<br> SQL.Add('OPENROWSET(''MSDASQL.1'',''driver=Microsoft Excel Driver (*.xls);'+'DBQ='+Edit1.Text+''','+'''select * from [sheet1$]'''+')');<br> ExecSQL;<br> Label2.Caption := '导入完成';<br> Application.MessageBox('数据导入完成!','提示',64);<br> end;