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

📄 form2.frm

📁 税务机关增值税专用发票抵扣联和发票联比对系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form2 
   Caption         =   "生成文件窗口"
   ClientHeight    =   3255
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6300
   ControlBox      =   0   'False
   LinkTopic       =   "Form2"
   ScaleHeight     =   3255
   ScaleWidth      =   6300
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text1 
      Height          =   270
      Left            =   120
      TabIndex        =   5
      Top             =   2040
      Width           =   3135
   End
   Begin MSAdodcLib.Adodc Adodc4 
      Height          =   375
      Left            =   2055
      Top             =   1050
      Visible         =   0   'False
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc4"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Command3 
      Caption         =   "退     出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2040
      TabIndex        =   4
      Top             =   2520
      Width           =   2175
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   375
      Left            =   3600
      Top             =   960
      Visible         =   0   'False
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   2
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc2"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   840
      Top             =   960
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   2
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Command2 
      Caption         =   "拷贝生成本地存根异地抵扣文件至软盘"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3360
      TabIndex        =   3
      Top             =   1320
      Width           =   2295
   End
   Begin VB.CommandButton Command1 
      Caption         =   "拷贝生成异地存根本地抵扣文件至软盘"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   600
      TabIndex        =   2
      Top             =   1320
      Width           =   2295
   End
   Begin VB.CommandButton Command12 
      Caption         =   "生成异地存根本地抵扣文件"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   480
      TabIndex        =   1
      Top             =   120
      Width           =   2295
   End
   Begin VB.CommandButton Command13 
      Caption         =   "生成本地存根异地抵扣文件"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3225
      TabIndex        =   0
      Top             =   120
      Width           =   2295
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
Dim q As Integer
Dim fil As File
Dim dr As Drive
On Error GoTo jj
q = MsgBox("拷贝文件前要生成抵扣文件,您生成此文件了吗??", 1)
If q = 1 Then
    If Not fso.FileExists("c:\gyk\dkk.txt") Then
        MsgBox ("您没有生成抵扣文件,请生成此文件!!")
        Exit Sub
    End If
    Set fil = fso.GetFile("c:\gyk\dkk.txt")
    Set dr = fso.GetDrive("a:")
    If dr.FreeSpace < fil.Size Then
        MsgBox ("软盘空间不够,请压缩拷贝!!")
        Exit Sub
    End If
    fso.CopyFile "c:\gyk\dkk.txt", "a:\dkk.txt", True
    MsgBox ("拷贝数据完成。")
End If
jj:
If Err.Number = 71 Then
    MsgBox ("请插入软盘或者软盘有问题,不能读写!!!")
    Exit Sub
End If
End Sub

Private Sub Command12_Click()
Form2.MousePointer = 3
Text1.Visible = True
Text1.ForeColor = &HFF0000
Text1.Text = "正在生成抵扣文件,请等待。。。"
Text1.Refresh
Dim ss As String
If Form1.Adodc4.Recordset.EOF Then
    MsgBox ("您没有输入地区税号,不能进行此操作!!")
    Exit Sub
End If
ss = Trim(Form1.Adodc4.Recordset!dqh)
Adodc1.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=qfgl"
Adodc1.CommandType = adCmdText
Adodc1.CursorLocation = adUseClient
Adodc1.RecordSource = "select * from dkk where left(gfsh,4)<>" & ss & " or Left(xfsh, 4) <> " & ss
Adodc1.Refresh
Dim rss As TextStream
If Not fso.FolderExists("c:\gyk") Then
fso.CreateFolder ("c:\gyk")
End If
Set rss = fso.CreateTextFile("c:\gyk\dkk.txt", True)
If Not Adodc1.Recordset.EOF Then
    Dim kk As Long
    Dim i As Long
    Adodc1.Recordset.MoveFirst
    kk = Adodc1.Recordset.RecordCount
    Adodc1.Recordset.MoveFirst
    For i = 1 To kk
        rss.WriteLine (Adodc1.Recordset!fpdm & Adodc1.Recordset!fph & Adodc1.Recordset!gfsh & Adodc1.Recordset!xfsh & Adodc1.Recordset!rq)
        Adodc1.Recordset.MoveNext
    Next i
    Form2.MousePointer = 0
    Text1.Visible = False
    MsgBox ("抵扣文件生成完毕!!")
Else
    Form2.MousePointer = 0
    Text1.Visible = False
    MsgBox ("全部是本地数据,抵扣文件为空!!")
    Exit Sub
End If
End Sub

Private Sub Command13_Click()
Form2.MousePointer = 3
Text1.Visible = True
Text1.ForeColor = &HFF0000
Text1.Text = "正在生成存根文件,请等待。。。"
Text1.Refresh
Dim ss As String
If Form1.Adodc4.Recordset.EOF Then
    MsgBox ("您没有输入地区税号,不能进行此操作!!")
    Exit Sub
End If
ss = Trim(Form1.Adodc4.Recordset!dqh)
Adodc2.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=qfgl"
Adodc2.CommandType = adCmdText
Adodc2.CursorLocation = adUseClient
Adodc2.RecordSource = "select * from cgk where left(gfsh,4)<>" & ss & " or Left(xfsh, 4) <> " & ss
Adodc2.Refresh
Dim rss As TextStream
If Not fso.FolderExists("c:\gyk") Then
fso.CreateFolder ("c:\gyk")
End If
Set rss = fso.CreateTextFile("c:\gyk\cgk.txt", True)
If Not Adodc2.Recordset.EOF Then
    Dim kk As Long
    Dim i As Long
    Adodc2.Recordset.MoveFirst
    kk = Adodc2.Recordset.RecordCount
    Adodc2.Recordset.MoveFirst
    For i = 1 To kk
        rss.WriteLine (Adodc2.Recordset!fpdm & Adodc2.Recordset!fph & Adodc2.Recordset!gfsh & Adodc2.Recordset!xfsh & Adodc2.Recordset!rq)
        Adodc2.Recordset.MoveNext
    Next i
    Form2.MousePointer = 0
    Text1.Visible = False
    MsgBox ("存根文件生成完毕!!")
Else
    Form2.MousePointer = 0
    Text1.Visible = False
    MsgBox ("全部是本地数据,存根文件为空!!")
    Exit Sub
End If
End Sub


Private Sub Command2_Click()
Dim q As Integer
Dim fil As File
Dim dr As Drive
On Error GoTo jj
q = MsgBox("拷贝文件前要生成存根文件,您生成此文件了吗??", 1)
If q = 1 Then
    If Not fso.FileExists("c:\gyk\cgk.txt") Then
        MsgBox ("您没有生成存根文件,请生成此文件!!")
        Exit Sub
    End If
    Set fil = fso.GetFile("c:\gyk\cgk.txt")
    Set dr = fso.GetDrive("a:")
    If dr.FreeSpace < fil.Size Then
        MsgBox ("软盘空间不够,请压缩拷贝!!")
        Exit Sub
    End If
    fso.CopyFile "c:\gyk\cgk.txt", "a:\cgk.txt", True
    MsgBox ("拷贝数据完成。")
End If
jj:
If Err.Number = 71 Then
    MsgBox ("请插入软盘或者软盘有问题,不能读写!!!")
    Exit Sub
End If
End Sub

Private Sub Command3_Click()
Unload Me
End Sub





Private Sub Form_Load()
Text1.Visible = False
End Sub

⌨️ 快捷键说明

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