?? deluser.frm
字號:
VERSION 5.00
Begin VB.Form deluser
Caption = "Form1"
ClientHeight = 2280
ClientLeft = 5370
ClientTop = 3930
ClientWidth = 5985
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 2280
ScaleWidth = 5985
Begin VB.Frame Frame2
Height = 1815
Left = 360
TabIndex = 3
Top = 120
Width = 3615
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 5
Top = 1080
Width = 2055
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
TabIndex = 4
Top = 360
Width = 2055
End
Begin VB.Label Label2
Caption = "密碼"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 7
Top = 1200
Width = 615
End
Begin VB.Label Label1
Caption = "姓名"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 360
TabIndex = 6
Top = 480
Width = 615
End
End
Begin VB.CommandButton Command2
Caption = "關閉(&C)"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 4440
TabIndex = 2
Top = 1200
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "刪除(&D)"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 4440
TabIndex = 1
Top = 360
Width = 1095
End
Begin VB.Frame Frame1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1815
Left = 4320
TabIndex = 0
Top = 120
Width = 1455
End
End
Attribute VB_Name = "deluser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mybookmark As Variant
Private Sub Command1_Click()
If Not Testtxt(Text1.Text) Then
MsgBox "請輸入用戶名!", 48, "提示"
Text1.SetFocus
Exit Sub
End If
txtSQL = "select * from user where 密碼 = '" & Trim(Text1.Text) & " '"
Set dream = ExecuteSQL(txtSQL, Msgtext)
' mybookmark = dream.Bookmark
If Text1.Text = dream.Fields(0) Then
str2$ = MsgBox(" 是否刪除此用戶?", vbOKCancel, "提示!")
If str2$ = vbOK Then
'dream.MoveNext
If dream.EOF Then 'recordset is empty?
'dream.MoveFirst
mybookmark = dream.Bookmark 'sign current position
dream.MoveLast
dream.Delete
dream.Close
txtSQL = "select * from user"
Set dream = ExecuteSQL(txtSQL, Msgtext)
dream.MoveLast
Else
mybookmark = dream.Bookmark 'sign current position
'dream.MovePrevious
dream.Delete
dream.Close
Text1.Text = ""
Text2.Text = ""
txtSQL = "select * from user"
Set dream = ExecuteSQL(txtSQL, Msgtext)
dream.MoveLast
End If
'Else
'dream.Bookmark = mybookmark 'return primary position
End If
Else
MsgBox "沒有此用戶!", 48, "提示"
Text1.Text = ""
Text2.Text = ""
End If
End Sub
Private Sub Command2_Click()
Unload Me
studentmdi.StatusBar1.Panels.Item(1).Text = " "
End Sub
Private Sub Form_Activate()
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Form_Load()
txtSQL = "select * from user "
Set dream = ExecuteSQL(txtSQL, Msgtext) 'excute query opertion
deluser.Height = 2685
deluser.Width = 6315
deluser.Caption = "刪除用戶信息[" + Format(Date, "yyyy年mm月dd日]")
studentmdi.StatusBar1.Panels.Item(1).Text = "刪除用戶信息"
End Sub
Public Sub viewdata() '由于程序中各處需要顯示數據,定義函數ViewData
Text1.Text = dream.Fields(0)
Text2.Text = dream.Fields(1)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -