?? frmaddbookstyle.frm
字號:
VERSION 5.00
Begin VB.Form frmaddbookstyle
Caption = "添加圖書類別"
ClientHeight = 3600
ClientLeft = 60
ClientTop = 450
ClientWidth = 5820
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3600
ScaleWidth = 5820
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3480
TabIndex = 5
Top = 2400
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 495
Left = 1200
TabIndex = 4
Top = 2400
Width = 1335
End
Begin VB.TextBox Text2
Height = 495
Left = 2160
TabIndex = 3
Top = 1200
Width = 3015
End
Begin VB.TextBox Text1
Height = 495
Left = 2160
TabIndex = 2
Top = 360
Width = 3015
End
Begin VB.Label Label2
Caption = "圖書編號"
Height = 375
Left = 480
TabIndex = 1
Top = 1320
Width = 1455
End
Begin VB.Label Label1
Caption = "圖書類別"
Height = 375
Left = 480
TabIndex = 0
Top = 480
Width = 1455
End
End
Attribute VB_Name = "frmaddbookstyle"
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_bookstyle As New ADODB.Recordset
If Trim(text1.Text) = "" Then
MsgBox "圖書種類不能為空 ", vbOK0nly + vbExclamation, ""
text1.SetFocus
Exit Sub
End If
If Trim(text2.Text) = "" Then
MsgBox "種類編號不能為空", vbOK0nly + vbExclamation, ""
text2.SetFocus
Exit Sub
End If
Provider = "Microsoft.Jet.OLEDB.3.5.1 ;Persist Security Info=false;data source=D:\圖書管理系統\database.mdb"
conn.Open "provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path & "\database.mdb"
sql = "select * from 圖書類別 where 類別名稱='" & text1.Text & "'"
rs_bookstyle.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_bookstyle.EOF Then
rs_bookstyle.AddNew
rs_bookstyle.Fields(0) = Trim(text1.Text)
rs_bookstyle.Fields(1) = Trim(text2.Text)
rs_bookstyle.Update
MsgBox "添加圖書類別成功!", vbOKOnly, ""
rs_bookstyle.Close
Else
MsgBox "圖書類別重復!", vbOKOnly + vbExclamation, ""
text1.SetFocus
text1.Text = ""
rs_bookstyle.Close
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -