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

📄 form_resetstock.frm

📁 仓库扫描管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form form_resetStock 
   BackColor       =   &H80000000&
   ClientHeight    =   2340
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3465
   Icon            =   "form_resetStock.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   ScaleHeight     =   2340
   ScaleWidth      =   3465
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdStart 
      Caption         =   "&S   开    始"
      Height          =   375
      Left            =   240
      TabIndex        =   1
      Top             =   1320
      Width           =   2775
   End
   Begin VB.TextBox txtPassword 
      BorderStyle     =   0  'None
      Height          =   320
      IMEMode         =   3  'DISABLE
      Left            =   840
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   480
      Width           =   2175
   End
   Begin VB.Label Label3 
      BackColor       =   &H80000000&
      Caption         =   "口令:"
      Height          =   255
      Left            =   240
      TabIndex        =   2
      Top             =   480
      Width           =   615
   End
End
Attribute VB_Name = "form_resetStock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdStart_Click()
    On Error GoTo errprompt
    Me.MousePointer = 11
    Dim destFilePath As String
    Dim rsPwd As Recordset
    Set rsPwd = g_db.OpenRecordset("select * from hp_sysParas where (((hp_sysParas.paraCode)='resetStockPwd'))")
    If rsPwd.RecordCount = 0 Then
        Me.MousePointer = 0
        MsgBox "对不起,尚未设置口令,请通知管理员!", vbCritical, "警告!"
        Exit Sub
    End If
    If rsPwd.RecordCount > 0 And rsPwd.Fields("paraValue") <> Me.txtPassword.Text Then
     Me.MousePointer = 0
        MsgBox "对不起,口令不对!", vbCritical, "警告!"
        Exit Sub
    End If
    
    Dim strPath, sql As String
    strPath = "C:\Program Files\HP\"
    If Dir(strPath, vbDirectory) = "" Then
      MkDir strPath
    End If
    destFilePath = strPath + "system" + CStr(Format(Now, "YYYYMMDDHHMMSS"))
    If destFilePath <> "" And g_dbPath <> destFilePath Then
        closeConnection
        FileCopy g_dbPath, destFilePath
'   删除出入库数据
On Error GoTo dberr
        createConnection
        wrks.BeginTrans
        sql = " delete from hpos_StockOutBill_Dtl "
        g_db.Execute (sql)
        sql = " delete from hpos_StockOutBill_Master "
        g_db.Execute (sql)
        sql = " delete from hpos_StockIncomeBill_Dtl "
        g_db.Execute (sql)
        sql = " delete from hpos_StockIncomeBill_Master "
        g_db.Execute (sql)
        wrks.CommitTrans
        Me.MousePointer = 0
        MsgBox "恭喜您,操作成功!", vbInformation, "提示"
        End
dberr:
        Me.MousePointer = 0
        wrks.Rollback
        End
    Else
        MsgBox "无效的路径!", vbCritical, "警告"
    End If
        Me.MousePointer = 0
        Exit Sub
errprompt:
    Me.MousePointer = 0
    Select Case Err.Number
      Case 57
        MsgBox "磁盘已满!", vbCritical
      Case 70
        MsgBox "磁盘写保护!", vbCritical
    End Select

End Sub

Private Sub Form_Load()
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) / 2
End Sub

Private Sub Form_Unload(Cancel As Integer)
 frm_main.Enabled = True
End Sub

⌨️ 快捷键说明

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