📄 word.frm
字号:
VERSION 5.00
Begin VB.Form word
Caption = "单词查询"
ClientHeight = 5400
ClientLeft = 60
ClientTop = 345
ClientWidth = 6330
LinkTopic = "Form1"
ScaleHeight = 5400
ScaleWidth = 6330
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "返回"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2160
TabIndex = 12
Top = 4800
Width = 1575
End
Begin VB.CommandButton Command7
Caption = "查询"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 1
Top = 480
Width = 1335
End
Begin VB.CommandButton Command6
Caption = "删除此单词"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3960
TabIndex = 9
Top = 4080
Width = 1335
End
Begin VB.CommandButton Command5
Caption = "编辑此单词"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2160
TabIndex = 8
Top = 4080
Width = 1575
End
Begin VB.CommandButton Command4
Caption = "加入新单词"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 7
Top = 4080
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "下一个"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3840
TabIndex = 6
Top = 3120
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "上一个"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 5
Top = 3120
Width = 1335
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 2
Top = 480
Width = 2655
End
Begin VB.Label Label5
Caption = "单词级别:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 11
Top = 2040
Width = 1095
End
Begin VB.Label Label4
AutoSize = -1 'True
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1560
TabIndex = 10
Top = 2040
Width = 1155
End
Begin VB.Label Label3
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 4
Top = 1320
Width = 3135
End
Begin VB.Label Label2
Caption = "汉语意思是:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 3
Top = 1320
Width = 1335
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请输入单词:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 240
TabIndex = 0
Top = 600
Width = 1260
End
End
Attribute VB_Name = "word"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As DAO.Database
Public rec As DAO.Recordset
Dim rec1 As DAO.Recordset
Private Sub Command1_Click()
Set rec1 = db.OpenRecordset("word")
If Text1.Text <> "" Then
Do While rec1!单词 <> Text1.Text
rec1.MoveNext
Loop
End If
If Not (rec1.BOF And rec1.EOF) Then
rec1.MovePrevious
If rec1.BOF Then
rec1.MoveFirst
End If
Text1.Text = rec1!单词
Command7_Click
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Set rec1 = db.OpenRecordset("word")
If Text1.Text <> "" Then
Do While rec1!单词 <> Text1.Text
rec1.MoveNext
Loop
End If
If Not (rec1.BOF And rec1.EOF) Then
rec1.MoveNext
If rec1.EOF Then
rec1.MoveLast
End If
Text1.Text = rec1!单词
Command7_Click
End If
End Sub
Private Sub Command4_Click()
word_in.Show
End Sub
Private Sub Command5_Click()
word_in.Show
word_in.Text1.Text = rec!单词
word_in.Text2.Text = rec!翻译
word_in.Cob.Text = rec!级别
End Sub
Private Sub Command6_Click()
If rec.RecordCount <> 0 Then
If MsgBox("确定要删除吗?", vbYesNo) = vbYes Then
rec.Delete
Set rec = db.OpenRecordset("select * from word ") '无法按单词排序
If Not (rec.BOF And rec.EOF) Then
rec.MoveFirst
Text1.Text = rec!单词
Label3.Caption = rec!翻译
Label4.Caption = rec!级别 & "级词汇"
End If
End If
End If
End Sub
Private Sub Command7_Click()
Set rec = db.OpenRecordset("select * from word where 单词='" & Text1.Text & "' order by 单词") '无法按单词排序
If rec.RecordCount > 0 Then
Label3.Caption = rec!翻译
Label4.Caption = rec!级别 & "词汇"
End If
End Sub
Private Sub Form_Load()
Set db = OpenDatabase(App.Path & "\sourse.mdb")
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -