📄 dlform.frm
字号:
VERSION 5.00
Begin VB.Form DlForm
Appearance = 0 'Flat
BackColor = &H80000000&
ClientHeight = 2565
ClientLeft = 60
ClientTop = 345
ClientWidth = 5985
Icon = "DlForm.frx":0000
LinkTopic = "Form1"
ScaleHeight = 2565
ScaleWidth = 5985
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton CmmTc
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 3720
TabIndex = 8
Top = 2040
Width = 1260
End
Begin VB.CommandButton CmmQd
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 960
TabIndex = 7
Top = 2040
Width = 1260
End
Begin VB.Frame Frame1
Appearance = 0 'Flat
BackColor = &H80000000&
ForeColor = &H80000008&
Height = 1920
Left = 120
TabIndex = 0
Top = 0
Width = 5700
Begin VB.ComboBox CboZt
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 2520
TabIndex = 3
Top = 240
Width = 2295
End
Begin VB.TextBox TxtKl
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 2520
PasswordChar = "*"
TabIndex = 2
Top = 1200
Width = 2895
End
Begin VB.ComboBox CboYf
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 2520
TabIndex = 1
Top = 720
Width = 2895
End
Begin VB.Image Image1
Height = 660
Left = 165
Picture = "DlForm.frx":0442
Stretch = -1 'True
Top = 915
Width = 900
End
Begin VB.Label Label4
BackColor = &H80000000&
Caption = "选择帐套"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 6
Top = 240
Width = 1095
End
Begin VB.Label Label2
BackColor = &H80000000&
Caption = "输入密码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 5
Top = 1320
Width = 975
End
Begin VB.Label Label1
BackColor = &H80000000&
Caption = "选择用户名"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 4
Top = 840
Width = 1215
End
End
End
Attribute VB_Name = "DlForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New ADODB.Connection
Dim mycommand As New ADODB.Command
Dim rstMy As New ADODB.Recordset
Private Sub CmmQd_Click()
If CboZt.ListIndex = -1 Or CboYf.ListIndex = -1 Then
Exit Sub
End If
If check(CboYf.ItemData(CboYf.ListIndex)) Then
Data = "GYZC" & CboZt.ItemData(CboZt.ListIndex)
Zt = CboZt.Text
User = CboYf.Text
Unload Me
Call sj
mainForm.Show
Else
MsgBox "密码不对请重输", vbInformation, "提示"
End If
End Sub
Private Sub CmmTc_Click()
Unload Me
End Sub
Private Sub Form_Load()
Call AddDataComboBox("select BH,Name from SYS ", CboZt)
Call AddDataComboBox("select ID,UserName from MyUser ", CboYf)
End Sub
Function AddDataComboBox(ByVal strSql As String, myComboBox As ComboBox)
If conn.state = 0 Then
conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=SYS"
conn.Open
End If
mycommand.ActiveConnection = conn
mycommand.CommandType = adCmdText
mycommand.CommandText = strSql
Set rstMy = mycommand.Execute
While Not rstMy.EOF()
myComboBox.AddItem (rstMy(1).Value)
myComboBox.ItemData(myComboBox.NewIndex) = rstMy.Fields(0).Value
rstMy.MoveNext
Wend
conn.Close
End Function
Function check(ByVal strMy As String) As Boolean
If conn.state = 0 Then
conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=SYS"
conn.Open
End If
mycommand.ActiveConnection = conn
mycommand.CommandType = adCmdText
mycommand.CommandText = "select Pword from MyUser where ID=" & strMy
Set rstMy = mycommand.Execute
If rstMy.Fields(0) = Trim(TxtKl.Text) Then
check = True
Else
check = False
End If
conn.Close
End Function
Sub sj() '得到年结月结时间
On Error GoTo err:
Dim i As Integer
Call sqlconn_open
mycommand.ActiveConnection = sqlconn
mycommand.CommandType = adCmdText
mycommand.CommandText = "select * from JZ"
Set rstMy = mycommand.Execute
JZYEAR = rstMy.Fields(0)
For i = 1 To rstMy.Fields.Count - 1
If rstMy.Fields(i) = True Then
JZMONTH = i
Else
Exit Sub
End If
Next
sqlconn.Close
Exit Sub
err:
MsgBox (err.Description)
End Sub
Private Sub Image1_Click()
Unload Me
JZ.Show 1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -