📄 usedel.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form usedel
BackColor = &H00FFFFFF&
BorderStyle = 3 'Fixed Dialog
Caption = "用户删除"
ClientHeight = 3765
ClientLeft = 45
ClientTop = 450
ClientWidth = 5535
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "usedel.frx":0000
ScaleHeight = 3765
ScaleWidth = 5535
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 720
Top = 4200
Width = 1455
_ExtentX = 2566
_ExtentY = 873
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 = "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 Command3
Caption = "查找"
Height = 615
Left = 3840
TabIndex = 5
Top = 1680
Width = 1335
End
Begin VB.TextBox Text1
Height = 495
Left = 1560
TabIndex = 3
Top = 1680
Width = 1695
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 735
Left = 3720
TabIndex = 1
Top = 2640
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "删除"
Height = 735
Left = 240
TabIndex = 0
Top = 2640
Width = 1455
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "usedel.frx":5BEC2
Height = 1575
Left = 0
TabIndex = 2
Top = 0
Width = 5535
_ExtentX = 9763
_ExtentY = 2778
_Version = 393216
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 3
BeginProperty Column00
DataField = "yhbh"
Caption = "用户编号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "yhmc"
Caption = "用户名"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
DataField = "yhmm"
Caption = "密码"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
BeginProperty Column02
EndProperty
EndProperty
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用户编号:"
Height = 495
Left = 240
TabIndex = 4
Top = 1800
Width = 1215
End
End
Attribute VB_Name = "usedel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public rs As New ADODB.Recordset
Private Sub Command1_Click()
On Error GoTo err
con.Open
Dim qq As String
If Text1.Text = "" Then
MsgBox "请输入要删除用户的编号"
Else
qq = "delete from yhb where yhbh='" & Text1.Text & "'"
con.Execute (qq)
MsgBox "成功删除", vbOKOnly + vbExclamation, "提示"
Unload Me
End If
con.Close
Exit Sub
err:
MsgBox "输入错误"
con.Close
End Sub
Private Sub Command2_Click()
Unload Me
frmmain.Show
End Sub
Private Sub Command3_Click()
Dim sq As String
On Error GoTo err
con.Open
sq = "select yhbh from yhb where yhbh='" & Text1.Text & "'"
Set rs = con.Execute(sq)
If Text1.Text = "" Then
MsgBox "学号不能为空!", vbOKOnly + vbInformation, "提示"
Text1.SetFocus
con.Close
Exit Sub
Else
If rs.BOF Or rs.EOF Then
MsgBox "该用户不存在", vbOKOnly + vbInformation, "提示"
Else
sq = "select *from yhb where yhbh='" & Text1.Text & "'"
Adodc1.ConnectionString = "Provider=SQLOLEDB;User ID=" & a & ";PWD=" & b & ";Initial Catalog=student;Data Source=" & d & ""
Adodc1.RecordSource = sq
Adodc1.Refresh
End If
End If
con.Close
Exit Sub
err:
MsgBox "输入错误"
con.Close
End Sub
Private Sub DataGrid1_Click()
Text1.Text = DataGrid1.Columns.Item(0)
End Sub
Private Sub Form_Load()
Call st1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -