扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
Try ExcelApplication1.Connect; Except End; ExcelApplication1.Visible[0]:=True; |
ExcelWorkbook1.ConnectTo(ExcelApplication1 Workbooks.Add(EmptyParam,0)); |
Var Temp_Worksheet: _WorkSheet; Begin Try Temp_Worksheet:=ExcelWorkbook1. WorkSheets.Add(EmptyParam, EmptyParam,EmptyParam,EmptyParam,0) as _WorkSheet; ExcelWorkSheet1.ConnectTo(Temp_WorkShee); Except ShowMessage(′Failure′); End; |
Try ExcelApplication1.Quit; ExcelWorksheet1.Disconnect; ExcelWorkbook1.Disconnect; ExcelApplication1.Disconnect; Except End; End; |
if OpenDialog1.Execute then Begin Try ExcelWorkBook1.ConnectTo(Excel Application1.Workbooks.Open(OpenDialog1FileName,EmptyParam,EmptyParam,Empty Param, EmptyParam, EmptyParam, EmptyParam,EmptyParam,EmptyParam, EmptyParam,EmptyParam, EmptyParam,EmptyParam,0)); ExcelWorkSheet1.ConnectTo(ExcelWorkBook1.Activesheet as _Worksheet); Except; End; |
Procedure TForm1.buttonclick(sender:tobject); Begin Shellexecute(handle,’open’,’ c:\sh60\sh60.exe’,’,’,sw-shownormal); Button3.enabled:=false; End; Procedure TForm1.formcreat(sender:tobject); Var i:integer: Begin Chdir(‘c:\sh60’); Form1.edit1.clear; Form1.memo1.clear; Assignfile(textid,form1.opendialog1.filename); For i:=1 to form1.adoquery1.sql.count do Begin Form1.adoquery1.close; Form1.adoquery1.clear; Form1.adoquery1.sq1.add(‘select 表名 from Formname’)close; Form1.adoquery1.open; Form1.dbcombox1.datafield:=’表名’; End; |
ADODataSet1.Connection :=ADOConnection1; ADODataSet1.CommandText :=select * from test; ADODataSet1.Active :=True; DataSource1.DataSet :=ADODataSet1; DBGrid1.DataSource :=DataSource1; |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者