?? form1.frm
字號(hào):
VERSION 5.00
Begin VB.Form frmaddreaderstyle
Caption = "讀者類別管理"
ClientHeight = 4965
ClientLeft = 60
ClientTop = 450
ClientWidth = 5820
LinkTopic = "Form1"
ScaleHeight = 4965
ScaleWidth = 5820
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3360
TabIndex = 9
Top = 3600
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 495
Left = 1200
TabIndex = 8
Top = 3600
Width = 1215
End
Begin VB.TextBox Text4
Height = 495
Left = 2400
TabIndex = 7
Top = 2400
Width = 1935
End
Begin VB.TextBox Text3
Height = 495
Left = 2400
TabIndex = 6
Top = 1800
Width = 1935
End
Begin VB.TextBox Text2
Height = 495
Left = 2400
TabIndex = 5
Top = 1080
Width = 1935
End
Begin VB.TextBox Text1
Height = 495
Left = 2400
TabIndex = 4
Top = 360
Width = 2295
End
Begin VB.Label Label7
Caption = "年"
Height = 255
Left = 4440
TabIndex = 12
Top = 2520
Width = 375
End
Begin VB.Label Label6
Caption = "天"
Height = 255
Left = 4440
TabIndex = 11
Top = 1920
Width = 375
End
Begin VB.Label Label5
Caption = "本"
Height = 255
Left = 4440
TabIndex = 10
Top = 1200
Width = 375
End
Begin VB.Label Label4
Caption = "有限期限"
Height = 375
Left = 840
TabIndex = 3
Top = 2520
Width = 1335
End
Begin VB.Label Label3
Caption = "借書期限"
Height = 375
Left = 840
TabIndex = 2
Top = 1920
Width = 1335
End
Begin VB.Label Label2
Caption = "借書數(shù)量"
Height = 375
Left = 840
TabIndex = 1
Top = 1200
Width = 1335
End
Begin VB.Label Label1
Caption = "讀者種類"
Height = 375
Left = 840
TabIndex = 0
Top = 480
Width = 1335
End
End
Attribute VB_Name = "frmaddreaderstyle"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim sql As String
Dim conn As New ADODB.Connection
Dim rs_readerstyle As New ADODB.Recordset
If Trim(Text1.Text) = "" Then
MsgBox "讀者種類不能為空 ", vbOK0nly + vbExclamation, ""
Text1.SetFocus
Exit Sub
End If
If Trim(Text2.Text) = "" Then
MsgBox "借書數(shù)量不能為空", vbOK0nly + vbExclamation, ""
Text2.SetFocus
Exit Sub
End If
If Trim(Text3.Text) = "" Then
MsgBox "借書期限不能為空", vbOK0nly + vbExclamation, ""
Text3.SetFocus
Exit Sub
End If
If Trim(Text4.Text) = "" Then
MsgBox "有限期限不能為空", vbOK0nly + vbExclamation, ""
Text4.SetFocus
Exit Sub
End If
'Provider = "Microsoft.Jet.OLEDB.3.5.1 ;Persist Security Info=false;data source=D:\圖書管理系統(tǒng)\database.mdb"
conn.Open "provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path & "\database.mdb"
sql = "select * from 讀者類別 where 種類名稱='" & Text1.Text & "'"
rs_readerstyle.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_readerstyle.EOF Then
rs_readerstyle.AddNew
rs_readerstyle.Fields(0) = Trim(Text1.Text)
rs_readerstyle.Fields(1) = Trim(Text2.Text)
rs_readerstyle.Fields(2) = Trim(Text3.Text)
rs_readerstyle.Fields(3) = Trim(Text4.Text)
rs_readerstyle.Update
MsgBox "添加讀者類別成功!", vbOKOnly, ""
rs_readerstyle.Close
Else
MsgBox "讀者類別重復(fù)!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
rs_readerstyle.Close
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -