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

📄 系统_登录窗体.frm

📁 新世纪ERP设备管理源代码
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Begin VB.ComboBox ZtCombo 
            Height          =   300
            Left            =   1050
            Style           =   2  'Dropdown List
            TabIndex        =   8
            Top             =   210
            Width           =   3315
         End
         Begin VB.CommandButton QdCommand 
            Caption         =   "确定(&O)"
            Height          =   300
            Left            =   2040
            TabIndex        =   3
            Top             =   2790
            Width           =   1120
         End
         Begin VB.CommandButton QxCommand 
            Caption         =   "取消(&C)"
            Height          =   300
            Left            =   3210
            TabIndex        =   7
            Top             =   2790
            Width           =   1120
         End
         Begin VB.Image Image1 
            Height          =   480
            Left            =   3870
            Picture         =   "系统_登录窗体.frx":03DE
            Top             =   1740
            Width           =   480
         End
         Begin VB.Line Line1 
            BorderColor     =   &H00FFFFFF&
            Index           =   1
            X1              =   180
            X2              =   4320
            Y1              =   2310
            Y2              =   2310
         End
         Begin VB.Line Line1 
            Index           =   0
            X1              =   180
            X2              =   4320
            Y1              =   2280
            Y2              =   2280
         End
         Begin VB.Label TsLabel 
            Caption         =   "密码:"
            Height          =   345
            Index           =   4
            Left            =   180
            TabIndex        =   18
            Top             =   1830
            Width           =   585
         End
         Begin VB.Label TsLabel 
            Alignment       =   1  'Right Justify
            AutoSize        =   -1  'True
            Caption         =   "用户名:"
            Height          =   180
            Index           =   2
            Left            =   165
            TabIndex        =   17
            Top             =   1410
            Width           =   630
         End
         Begin VB.Label TsLabel 
            Alignment       =   1  'Right Justify
            Caption         =   "公司帐套:"
            Height          =   255
            Index           =   0
            Left            =   120
            TabIndex        =   16
            Top             =   270
            Width           =   855
         End
         Begin VB.Label TsLabel 
            Alignment       =   1  'Right Justify
            Caption         =   "会计年度:"
            Height          =   345
            Index           =   1
            Left            =   150
            TabIndex        =   15
            Top             =   660
            Width           =   825
         End
         Begin VB.Label TsLabel 
            Alignment       =   1  'Right Justify
            Caption         =   "操作日期:"
            Height          =   345
            Index           =   3
            Left            =   150
            TabIndex        =   14
            Top             =   1050
            Width           =   825
         End
      End
   End
End
Attribute VB_Name = "XT_login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Xtsjljc As String                       '系统数据服务器连接串
Dim ErpPassWord As String                   '系统连接密码
Dim Cslj As New ADODB.Connection            '测试连接(为屏蔽提示信息)
Dim Tsxx As String                          '系统提示信息
Dim Czyrec As New ADODB.Recordset           '操作员动态集
Dim Xtrlrec As New ADODB.Recordset          '系统日历动态集
Dim Ztdqsjk As String                       '所选帐套当前数据库
Private Function Ljyxxpd() As Boolean       '数据服务器(系统基本信息库)连接有效性测试
    Ljyxxpd = False
    If Len(Trim(ServerText.Text)) = 0 Then
        Tsxx = "数据服务器名不能为空!"
        Call Xtxxts(Tsxx, 0, 1)
        ServerText.SetFocus
        Exit Function
    End If
    Xtsjljc = "Provider=SQLOLEDB.1;"
    
    Xtsjljc = Xtsjljc + "Persist Security Info=False;"
    
    Xtsjljc = Xtsjljc + "Data Source=" + Trim(ServerText.Text) + ";"
    
    Xtsjljc = Xtsjljc + " Initial Catalog=" + "Master" + ";"
    
    If Cslj.State = 1 Then Cslj.Close
    
    DdtsLabel = "系统正在连接数据服务器,请稍等..."
    DdtsLabel.Refresh
    With Me.Animation1
        .Visible = True
        .Open App.Path + "\Ljcs.avi"
        .Play
    End With
    On Error GoTo Cwcl
    
    If Cslj.State = 1 Then Cslj.Close
    Cslj.Open Xtsjljc, "Hxxd", ErpPassWord
    
    Animation1.Stop
    Animation1.Visible = False
    
    DdtsLabel = ""
    DdtsLabel.Refresh
      
    Ljyxxpd = True
    
    Exit Function
    
Cwcl:
    Animation1.Visible = False
    Animation1.Stop
    DdtsLabel = ""
    Tsxx = "数据服务器连接测试失败!"
    Call Xtxxts(Tsxx, 0, 1)
    Exit Function
  
End Function
Private Sub CzrqText_KeyPress(KeyAscii As Integer)      '录入日期限制
    Call Lrrqxz(KeyAscii)
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)          '控 制 焦 点 转 移
    Dim jdzygs As Integer
    jdzygs = 12
    Select Case KeyAscii
        Case vbKeyReturn
            If Kjjdzy(jdzygs) Then
                KeyAscii = 0
            End If
        Case 39           '屏蔽"'"
            KeyAscii = 0
    End Select
End Sub
Private Sub Form_Load()
    App.HelpFile = App.Path + "\设备管理.chm"
    
    XtMenuList = "01%"         '子系统菜单系统代号
    
    ErpPassWord = "123"
    
    Call Qcljnr     '读入连接内容
    
    With StTab
        .TabEnabled(0) = False
        Frame1(0).Enabled = False
        .TabEnabled(1) = True
        Frame1(1).Enabled = True
        .TabEnabled(2) = False
        Frame1(2).Enabled = False
         StTab.Tab = 1
    End With
    
End Sub
Private Sub GgszCommand_Click()
    With Me.StTab
        .TabEnabled(0) = False
        Frame1(0).Enabled = False
        .TabEnabled(1) = True
        Frame1(1).Enabled = True
        .Tab = 1
    End With
    
    ' 让数据服务器设置文本框得到焦点
    ServerText.SetFocus
    ServerText.SelStart = 0
    ServerText.SelLength = Len(ServerText.Text)
End Sub
Private Sub LjqdCommand_Click()                              '保 存 设 置
 
    If Ljyxxpd Then
        If Cw_DataEnvi.BaseInfoConnect.State = 1 Then Cw_DataEnvi.BaseInfoConnect.Close
        Cw_DataEnvi.BaseInfoConnect.Open Xtsjljc, "Hxxd", ErpPassWord
        
        Tsxx = "连接测试成功!"
        Call Xtxxts(Tsxx, 0, 4)
        
        StTab.TabEnabled(1) = False
        Frame1(1).Enabled = False
        StTab.TabEnabled(0) = True
        Frame1(0).Enabled = True
        StTab.Tab = 0
        Call Tcztxx
        
        If ZtCombo.ListCount > 0 Then
            ZtCombo.ListIndex = 0
        End If
    End If
End Sub
Private Sub Qcljnr()                                         '取 出 数 据
    Dim Fsote As New FileSystemObject, Tste As TextStream
    Dim Dqhs As Integer, Dqnr As String
    Dqhs = 5
    On Error GoTo Cwcl:
    Set Tste = Fsote.OpenTextFile(App.Path + "\新世纪erp.txt", 1)
    For jsqte = 1 To Dqhs
        Dqnr = Trim(Tste.ReadLine)
        If InStr(1, UCase(Dqnr), "SQLSERVER=") <> 0 Then
            ServerText.Text = Mid(Dqnr, InStr(1, UCase(Dqnr), "SQLSERVER=") + 10, Len(Dqnr))
        End If
        If InStr(1, UCase(Dqnr), "ACCOUNT=") <> 0 Then
            str_Account = Mid(Dqnr, InStr(1, UCase(Dqnr), "ACCOUNT=") + 8, Len(Dqnr))
            Dim int_Count As Integer
             
            For int_Count = 0 To ZtCombo.ListCount - 1
                If UCase(Mid(ZtCombo.List(int_Count), 1, InStr(ZtCombo.List(int_Count), "-") - 1)) = UCase(Mid(str_Account, 1, InStr(str_Account, "-") - 1)) Then
                    ZtCombo.ListIndex = int_Count
                End If
            Next int_Count
        End If
    Next jsqte
    Exit Sub
Cwcl:
    Exit Sub
End Sub
Private Sub QdCommand_Click()          '确定进入系统
    If Trim(CzyCombo.Text) = "" Then Exit Sub
    
    Set Czyrec = Cw_DataEnvi.DataConnect.Execute("Select * From gy_czygl where czybm='" + Trim(CzyCombo.Text) + "' or czymc='" & Trim(CzyCombo.Text) & "' or rtrim(czybm)+'-'+rtrim(czymc)='" & Trim(CzyCombo.Text) & "'")
    With Czyrec
        If Not .EOF Then
        CzyCombo.Text = Trim(.Fields("czybm")) + "-" + Trim(.Fields("czymc"))
        Else
            Tsxx = "无此用户名!"
            Call Xtxxts(Tsxx, 0, 1)
            Exit Sub
        End If
    End With
    Czyrec.Close
    Set Czyrec = Nothing


    If Xtyxxpd Then
        If Ljyxxpd1 Then
            If Cw_DataEnvi.DataConnect.State = 1 Then Cw_DataEnvi.DataConnect.Close
            Cw_DataEnvi.DataConnect.Open Xtsjljc, "Hxxd", ErpPassWord
        End If
        QdCheck.Value = 1
        Me.Hide
        
        Dim Fsote As New FileSystemObject, Tste As TextStream
        Set Tste = Fsote.CreateTextFile(App.Path + "\新世纪erp.txt", True)
        Tste.WriteLine "Sqlserver=" + Trim(ServerText.Text)
        Tste.WriteLine "Account=" + Trim(ZtCombo.Text)
        Tste.Close
        
        CtdrCheck.Value = 1
        GgszCommand.Enabled = False
        XT_Main.Show
        
        Xt_Control.tvTreeView.Visible = False
        Xt_Control.tvTreeView.Nodes.Clear
        Xt_Control.Cshgns
        Xt_Control.tvTreeView.Refresh
        Xt_Control.tvTreeView.Visible = True
    End If
End Sub
Private Sub QxCommand_Click()                                     '取消进入系统
    If CtdrCheck.Value <> 1 Then
        Unload Me

⌨️ 快捷键说明

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