VB6.0引用EXcel2007提示“实时错误48,加载DLL错误”代码如下 5
Case"1#/2#主机供回水温度"'日报时间strDay=Format(Me.dtpDay.Value,"yyyy-m-d")'实例化ADOSetcnADO=NewAD...
Case "1#/2#主机供回水温度"' 日报时间 strDay = Format(Me.dtpDay.Value, "yyyy-m-d")' 实例化ADO Set cnADO = New ADODB.Connection Set rsADO = New ADODB.Recordset' 连接Access cnADO.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\HistData.mdb;User ID=;Password=;" cnADO.Open'执行查询 Sql = "SELECT * FROM WD1 " & _ " WHERE HTDate >= #" & strDay & "# AND HTDate <= #" & DateAdd("d", 1, strDay) & "#" & _ " ORDER BY HTDate,HTTime" rsADO.CursorLocation = adUseClient rsADO.Open Sql, cnADO, adOpenDynamic, adLockReadOnly, -1 'adOpenDynamic, adLockUnspecified, -1 If rsADO.RecordCount <= 0 Then MsgBox "无数据!", vbOKOnly + vbInformation, "信息..." Set cnADO = Nothing Set rsADO = Nothing Exit Sub End If Dim xlApp As Excel.Application Dim xlBook As Object Dim xlSheet As Object Dim Temp(1 To 8) As Integer Dim i, j As Integer'Excel打开模板 Set xlApp = New Excel.Application xlApp.DisplayAlerts = False xlApp.Visible = False Set xlBook = xlApp.Workbooks.Open(App.Path & "\1#2#主机供回水温度.xlt") Set xlSheet = xlBook.Worksheets(1)
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询