Option Explicit
Public Sub ToExcelZgcl(ByRef xlbook, ByRef xls) ''输出总工程量
Dim con As New ADODB.Connection
Dim rst_gcl As New ADODB.Recordset
Dim rst_qm As New ADODB.Recordset
''**************************连接数据库****************************************
con.CursorLocation = adUseClient
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strConnection & ";Persist Security Info=False"
con.Open
rst_gcl.Open "zonggcl", con, adOpenKeyset, adLockOptimistic, adCmdTable ''打开工程量汇总表
If Not (rst_gcl.BOF And rst_gcl.EOF) Then
rst_gcl.MoveFirst
End If
rst_qm.Open "qianming", con, adOpenKeyset, adLockOpti