📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3525
ClientLeft = 60
ClientTop = 465
ClientWidth = 6330
LinkTopic = "Form1"
ScaleHeight = 3525
ScaleWidth = 6330
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "登陆 "
Height = 615
Left = 1800
TabIndex = 2
Top = 2280
Width = 1095
End
Begin VB.TextBox Text2
Height = 615
Left = 1560
TabIndex = 1
Top = 1440
Width = 1695
End
Begin VB.TextBox Text1
Height = 615
Left = 1560
TabIndex = 0
Top = 480
Width = 1695
End
Begin VB.Label Label2
Caption = "密码:"
Height = 375
Left = 240
TabIndex = 4
Top = 1560
Width = 855
End
Begin VB.Label Label1
Caption = "用户名:"
Height = 375
Left = 240
TabIndex = 3
Top = 600
Width = 855
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
Private Sub Command1_Click()
Dim intI As Integer
Dim strMsg As String
Set cmd.ActiveConnection = conn
With cmd
.CommandType = adCmdStoredProc
.CommandText = "proc_login"
.Parameters.Item("@u_name").Value = Text1.Text
.Parameters.Item("@u_pwd").Value = Text2.Text
.Execute
End With
intI = cmd.Parameters.Item("@intI").Value
strMsg = cmd.Parameters.Item("@str_msg").Value
If intI = 1 Then
Form2.Show
Else
MsgBox strMsg, vbInformation, "温馨提示!"
End If
End Sub
Private Sub Form_Load()
connOpen
End Sub
Private Sub connOpen()
If conn.State = adStateClosed Then
conn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=db_user"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -