form2.frm
来自「校园导游管理系统!!这个应该对很多人都比较有用」· FRM 代码 · 共 120 行
FRM
120 行
VERSION 5.00
Begin VB.Form Form2
Caption = "Form2"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form2"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text5
Height = 495
Left = 1200
TabIndex = 10
Top = 2280
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "确认"
Height = 495
Left = 3000
TabIndex = 4
Top = 2280
Width = 1455
End
Begin VB.TextBox Text4
Height = 615
Left = 3000
TabIndex = 3
Top = 1080
Width = 975
End
Begin VB.TextBox Text3
Height = 495
Left = 1200
TabIndex = 2
Top = 1200
Width = 855
End
Begin VB.TextBox Text2
Height = 495
Left = 3000
TabIndex = 1
Top = 360
Width = 975
End
Begin VB.TextBox Text1
Height = 495
Left = 1200
TabIndex = 0
Top = 360
Width = 855
End
Begin VB.Label Label5
Caption = "照片"
Height = 375
Left = 240
TabIndex = 9
Top = 2280
Width = 495
End
Begin VB.Label Label4
Caption = "成绩"
Height = 375
Left = 2280
TabIndex = 8
Top = 1200
Width = 615
End
Begin VB.Label Label3
Caption = "课程"
Height = 375
Left = 240
TabIndex = 7
Top = 1200
Width = 735
End
Begin VB.Label Label2
Caption = "姓名"
Height = 375
Left = 2280
TabIndex = 6
Top = 480
Width = 495
End
Begin VB.Label Label1
Caption = "学号"
Height = 495
Left = 240
TabIndex = 5
Top = 360
Width = 615
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim a As String
cnn.Open "provider=sqloledb;server=(local);uid=sa;pwd=;database=student"
rs.Open "select * from 学生", cnn, adOpenKeyset, adLockOptimistic, adCmdText
rs.AddNew
rs.Fields("学号") = Text1
rs.Fields("姓名") = Text2
rs.Fields("课程") = Text3
rs.Fields("成绩") = Text4
rs.Fields("照片") = LoadPicture("d:\a.gif")
rs.Update
rs.Close
cnn.Close
Unload Me
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?