?? form4.frm
字號:
VERSION 5.00
Begin VB.Form Form4
Caption = "Form4"
ClientHeight = 7230
ClientLeft = 60
ClientTop = 510
ClientWidth = 6090
LinkTopic = "Form4"
ScaleHeight = 7230
ScaleWidth = 6090
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "返回"
Height = 495
Left = 4680
TabIndex = 13
Top = 6000
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "保存"
Height = 495
Left = 4680
TabIndex = 12
Top = 5160
Width = 975
End
Begin VB.Frame Frame1
Caption = "輸入信息"
Height = 6375
Left = 480
TabIndex = 0
Top = 480
Width = 3855
Begin VB.TextBox Text6
Height = 615
Left = 1560
TabIndex = 14
Top = 2400
Width = 1935
End
Begin VB.TextBox Text5
Height = 495
Left = 1560
TabIndex = 11
Top = 5280
Width = 1815
End
Begin VB.TextBox Text4
Height = 495
Left = 1560
TabIndex = 10
Top = 4440
Width = 1575
End
Begin VB.TextBox Text3
Height = 495
Left = 1560
TabIndex = 9
Top = 3480
Width = 1695
End
Begin VB.TextBox Text2
Height = 495
Left = 1560
TabIndex = 8
Top = 1440
Width = 2055
End
Begin VB.TextBox Text1
Height = 495
Left = 1560
TabIndex = 7
Top = 600
Width = 1455
End
Begin VB.Label Label6
Caption = "電話"
Height = 735
Left = 120
TabIndex = 6
Top = 5400
Width = 1335
End
Begin VB.Label Label5
Caption = "所屬院系"
Height = 615
Left = 120
TabIndex = 5
Top = 4440
Width = 1095
End
Begin VB.Label Label4
Caption = "年齡"
Height = 615
Left = 120
TabIndex = 4
Top = 3480
Width = 1215
End
Begin VB.Label Label3
Caption = "性別"
Height = 735
Left = 120
TabIndex = 3
Top = 2400
Width = 1095
End
Begin VB.Label Label2
Caption = "學生學號"
Height = 615
Left = 120
TabIndex = 2
Top = 1440
Width = 1095
End
Begin VB.Label Label1
Caption = "學生姓名"
Height = 495
Left = 120
TabIndex = 1
Top = 600
Width = 975
End
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim i As Integer
Set cn = New ADODB.Connection
cn.ConnectionString = "driver={sql server};server=FU;uid=sa;pwd=;database=sinformation"
cn.Open
Set rs = New ADODB.Recordset
rs.Open "select * from student", cn, adOpenDynamic, adLockOptimistic
If IsNumeric(Text3.Text) Then
rs.AddNew
rs.Fields(0) = Text1.Text
rs.Fields(1) = Text2.Text
rs.Fields(2) = Text6.Text
rs.Fields(3) = Text3.Text
rs.Fields(4) = Text4.Text
rs.Fields(5) = Text5.Text
rs.Update
rs.Close
MsgBox "學生信息添加成功", , "提示"
If MsgBox("你是否還要添加該學生的成績信息", vbYesNo, "提示") = vbYes Then
Form7.Text1.Text = Text1.Text
Form7.Text2.Text = Text2.Text
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Form4.Hide
Form7.Show
End If
Else
MsgBox "請在年齡框內輸入數字", , "警告"
SendKeys "{home}+{end}"
End If
End Sub
Private Sub Command2_Click()
Form4.Hide
Form1.Show
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -