| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 460 人关注过本帖
标题:代码怎样解释?
只看楼主 加入收藏
sa1888
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-8-20
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
代码怎样解释?
Private Sub CommandButton2_Click()
  Dim Moth As Integer
  Dim Maxrow As Integer, I As Integer
  Dim CNN As New ADODB.Connection
  Dim RS As New ADODB.Recordset
  Dim pthStr As String
  Dim SQL As String
  Application.ScreenUpdating = False
  pthStr = ThisWorkbook.Path & Application.PathSeparator & "分录表2013.mdb"
  CNN.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & pthStr
  Sheets("总分类账").[G4] = Format(, "00") & "月"
  Maxrow = [A65536].End(xlUp).Row
  If ComboBox1.Value = "" Then
  CNN.Close
  Exit Sub
  Else
  PBar1.Max = Maxrow - 7
  For I = 7 To Maxrow
  PBar1.Value = I - 7
  SQL = " Select sum(iif(isnull(借方金额),0,借方金额)),sum(iif(isnull(贷方金额),0,贷方金额)) from (" & _
        "select 月,借方金额,贷方金额 from flb where 科目编码 like '" & CStr(Cells(I, 1)) & "') where 月=" & CInt(ComboBox1.Value)
  RS.Open SQL, CNN, adOpenKeyset, adLockOptimistic
  Cells(I, "F").CopyFromRecordset RS
  Set RS = Nothing
  Next I
  PBar1.Max = Maxrow - 7
  For I = 7 To Maxrow
  PBar1.Value = I - 7
  SQL = " Select sum(iif(isnull(借方金额),0,借方金额)),sum(iif(isnull(贷方金额),0,贷方金额)) from (" & _
        "select 月,借方金额,贷方金额 from flb where 科目编码 like '" & CStr(Cells(I, 1)) & "') where 月<=" & CInt(ComboBox1.Value)
  RS.Open SQL, CNN, adOpenKeyset, adLockOptimistic
  Cells(I, "H").CopyFromRecordset RS
  Set RS = Nothing
  Next I
  End If
  CNN.Close
  Call 合计
  Unload Me
  Application.ScreenUpdating = True
  MsgBox "总分类账的数据汇总完毕!", vbInformation, "凭证处理系统"
End Sub
搜索更多相关主题的帖子: source False 
2013-08-20 12:34
sa1888
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-8-20
收藏
得分:0 
请高手们帮帮解释一下。急求!!!












2013-08-20 12:45
tonoy
Rank: 2
等 级:论坛游民
帖 子:24
专家分:72
注 册:2013-8-25
收藏
得分:20 
你这不是纯属的伸手党么?
2013-08-25 18:08
快速回复:代码怎样解释?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020499 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved