⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bankdatamake.frm

📁 适合乡镇供电所使用电费处理系统v3 软件
💻 FRM
📖 第 1 页 / 共 2 页
字号:

    If GetSetting(App.EXEName, "BankInfo", "Deduck", "") = "1" Then
       Option1.Value = True
    Else
       Option2.Value = True
    End If
    
    GzYue = Format(Month(Date), "0#")
    Call sTruInfo
    temp_str = ""
    cmd_raise.Enabled = False
    Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
    If Right$(App.Path, 1) = "\" Then
           temp_str = App.Path
    Else
           temp_str = App.Path & "\"
    End If
    co = 0
   
    adotemp.ConnectionString = "DBQ=" & App.Path & "\Data\Eletricity.Mdb" & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=281;FIL=MS Access;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;PWD=;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;"
    adotemp.RecordSource = "select  distinct 镇代码,村代码,简称  from 村档案 order by 镇代码 asc"
    adotemp.Refresh
    p_bar.Visible = False
    With adotemp.Recordset
        If .RecordCount <> 0 Then
           For i = 0 To .RecordCount - 1
                List_town.AddItem .Fields("镇代码") & .Fields("村代码") & Space(3) & .Fields("简称")
                If .AbsolutePosition = .RecordCount Then
                   .MoveLast
                Else
                   .MoveNext
                End If
            Next
         Else
            p_bar.Value = 100
            MsgBox "数据库中暂时无记录!请与系统管理员联系!", vbCritical
            Exit Sub
         End If
    End With
End Sub

'确定
Private Sub cmd_raise_Click()
    
    If cmd_raise.Caption = "确定(&O)" Then
            Dim temp As String
            Dim i As Integer
            Dim filetemp As String
            Dim myrecord As String
            Dim lens As Integer
            Dim mypath As String
            Dim bank_code As String
            
            Screen.MousePointer = 11
            adotemp.RecordSource = "select  * from 系统信息"
            adotemp.Refresh
            
        '    On Error GoTo hander
            If adotemp.Recordset.RecordCount <> 0 Then
                    bank_code = adotemp.Recordset.Fields("信用代码")
            Else
                    bank_code = "00"
            End If
            
            lens = 15
            filetemp = ""
            Me.cmd_exit.Enabled = False
            temp = ""
            mypath = App.Path
            If Right(mypath, 1) <> "\" Then
                    mypath = mypath & "\"
            End If
            
            filetemp = Right(Year(Date), 2) & Format(Month(Date), "0#")
            If List_town.ListCount <> 0 Then
                For i = 0 To List_town.ListCount - 1
                    If List_town.Selected(i) = True Then
                          temp = temp & "'" & Left(List_town.List(i) & Space(5), 6) & "',"
                    End If
                Next
                temp = Left$(temp, Len(temp) - 1)
            End If
            p_bar.Visible = True
             
            Me.Refresh
            p_bar.Visible = True
            p_bar.Enabled = True
            p_bar.Refresh
            p_bar.Value = 0
            adotemp.RecordSource = "select 用户电费.组合编码,用户电费.用户编码,用户电费.镇村代码,用户电费.用户名称,用户电费.[" & HH & "] AS 合计电费 from 用户电费  where 用户电费.镇村代码 IN( " & temp & ")  order by 用户电费.组合编码 asc"
            adotemp.Refresh
            With adotemp.Recordset
                 If .RecordCount <> 0 Then
                    Open mypath & "bank\NDF" & filetemp & ".TXT" For Output As #1
                    'Dim OpenForms
                    For i = 0 To .RecordCount - 1
                     p_bar.Value = (i + 1) / .RecordCount * 100
                          '   Call convert_str(.Fields("用户名称") & "")
                             myrecord = Trim(bank_code & Mid(.Fields!镇村代码, 2, 2) & Mid(.Fields!镇村代码, 5, 2)) & .Fields("用户编码") & Left(Trim(.Fields("用户名称")) & Space(40), 16 - count_hz) & Right(Space(20) & Trim(Format(.Fields("合计电费"), "0.00")), 8) & Space(13)
                             'Text1.Text = Text1.Text & myrecord + vbCrLf
                             Print #1, myrecord
                             If .AbsolutePosition = .RecordCount Then
                                .MoveLast
                             Else
                                .MoveNext
                             End If
                          'OpenForms = DoEvents
                          DoEvents
                    Next
                    Close #1
                 Else
                    p_bar.Value = 100
                 End If
                 cmd_select_all.Enabled = False
                 cmd_select_part.Enabled = False
                 If Option1.Value Then
                    cmd_raise.Caption = "拷贝(&K)"
                 Else
                    cmd_raise.Caption = "联网(&L)"
                 End If
                 cmd_exit.Enabled = True
            End With
            Screen.MousePointer = 0
            Exit Sub
     Else   '拷贝至软盘
            Dim ret_code As Long
            
            lens = 15
            filetemp = ""
            temp = ""
            MsgBox "请将软盘插入软驱再继续!", vbInformation
            Screen.MousePointer = 11
            filetemp = Right(Year(Date), 2) & Format(Month(Date), "0#")
            mypath = App.Path
            If Right(mypath, 1) <> "\" Then
                    mypath = mypath & "\"
            End If
            
            On Error GoTo hander
            Dir ("a:\*.*")
            If FileExists("a:\ndf" & filetemp & ".txt") = True Then
               Kill "a:\ndf" & filetemp & ".txt"
            End If
            ret_code = CopyFile(mypath & "bank\ndf" & filetemp & ".txt", "a:\ndf" & filetemp & ".txt", True)
             
            If ret_code <> 0 Then
               MsgBox "信用社代扣数据已经成功拷贝!" & Chr(13) & "文件名称为NDF" & filetemp & ".txt", vbInformation
               Screen.MousePointer = 0
               Exit Sub
            End If
            Screen.MousePointer = 0
            Exit Sub
     End If

hander:
      Select Case Err.Number
             Case 52:
                    MsgBox "软驱没有磁盘或磁盘没插好!", vbCritical
                    Screen.MousePointer = 0
                    Exit Sub
             Case 53:
                    MsgBox "文件没找到!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case 54:
                    MsgBox "文件模式错误!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case 55:
                    MsgBox "文件已打开!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case 61:
                    MsgBox "磁盘已满!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case 62:
                    MsgBox "文件太大!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case 63:
                    MsgBox "文件记录号错误!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case 68:
                    MsgBox "设备不可用!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case 70:
                    MsgBox "对不起,无权访问!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case 71:
                    MsgBox "磁盘没准备好!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case 75:
                    MsgBox "文件路径不对或文件错误!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case 76:
                    MsgBox "路径没找到!", vbInformation
                    Screen.MousePointer = 0
                    Exit Sub
             Case Else
                    MsgBox Err.Number & Space(2) & Err.Description
      End Select

End Sub

Private Sub cmd_select_all_Click()
    Dim i As Integer
    If List_town.ListCount <> 0 Then
       For i = 0 To List_town.ListCount - 1
           List_town.Selected(i) = True
       Next
    End If
End Sub

Private Sub cmd_select_part_Click()
    Dim i As Integer
    If List_town.ListCount <> 0 Then
        For i = 0 To List_town.ListCount - 1
            List_town.Selected(i) = False
        Next
    End If
    List_town.ListIndex = 0
End Sub

Private Sub List_town_Click()
    Dim i As Integer
    If List_town.ListCount <> 0 Then
        For i = 0 To List_town.ListCount - 1
            If List_town.Selected(i) Then
                cmd_raise.Enabled = True
                Exit For
            Else
                cmd_raise.Enabled = False
            End If
        Next
        List_town.ListIndex = 0
    End If
End Sub


'Function convert_str(mystring As String) As Integer
'    Dim i As Integer
'    Dim temp As String
'        temp = ""
'        count_hz = 0
'        For i = 0 To Len(mystring) - 1
'           If Asc(Mid(mystring, i + 1, 1)) < 0 Then
'                 count_hz = count_hz + 1
'           End If
'        Next
'End Function

Private Sub adotemp_Error(ByVal ErrorNumber As Long, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, fCancelDisplay As Boolean)
    MsgBox "数据库连接失败!!!", vbInformation
    fCancelDisplay = True
    Screen.MousePointer = 0
    Unload Me
End Sub

Private Sub cmd_exit_Click()
    Unload Me
End Sub

Private Sub Option1_Click()
    Me.Width = 4590
    Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
End Sub

Private Sub Option2_Click()
    Me.Width = 8895
    Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
End Sub




'在以前的日子里,每每春节将至,我等外出挣“外汇”的蒙城人,都有种强烈的盼归的念头,但
'但近年来,这种感情都在惊惊战战中产生,想到蒙城那些跑运输的长途车老板那种手拿利刃,面貌狰狞,
'预把老乡快速一刀,自己大发横财的样子,我们都有种莫明的伤感和无奈,想到乡下翘首盼儿归,村头等夫回的父母,妻儿
'那回家过年的喜悦顷刻化为的惆怅。由此我想到蒙城的经济要想健康的前进发展,必须把这种拿起刀子屠杀自己老乡(同时殊不知也是自己屠杀自己,屠杀蒙城的经济环境,屠杀外来欲投资的商家)的车老板式的
'人物进行教育(狠狠的打击),教育他们要细水长流,不要想一口吃个胖子。同时也希望所有的蒙城人都能表现有头脑,有眼光。我们常这么想,现在我们在外地打工,我门希望有一天(不是很久)我们回家打工!
'另外,蒙城的知名度随着县长牛群的努力宣传,现在也收到很好的各种效应,这也是一种财富,一种基础财富(我们蒙城本来基础就很差),我们不希望这种财富和原有的财富,被一些见利忘长远,只顾自己的人所破坏掉!
'我很希望蒙城的有识之士能共同来讨论怎样提高蒙城的一切素质,也希望牛群和蒙城的有关父母官也能真正把发展蒙城为己任,真真实实的建设蒙城,建设蒙城的一切!

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -