?? form14.frm
字號:
VERSION 5.00
Begin VB.Form Form10
BorderStyle = 1 'Fixed Single
Caption = "課程信息修改"
ClientHeight = 4995
ClientLeft = 45
ClientTop = 330
ClientWidth = 6180
LinkTopic = "Form10"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4995
ScaleWidth = 6180
Begin VB.CommandButton Command4
Caption = "退出"
Height = 855
Left = 4080
TabIndex = 9
Top = 4080
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "保存"
Height = 855
Left = 1800
TabIndex = 8
Top = 4080
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "修改"
Height = 855
Left = 240
TabIndex = 7
Top = 4080
Width = 1095
End
Begin VB.TextBox Text3
Height = 855
Left = 1200
TabIndex = 6
Top = 3000
Width = 1815
End
Begin VB.TextBox Text2
Height = 735
Left = 1200
TabIndex = 5
Top = 2040
Width = 1815
End
Begin VB.Frame Frame1
BackColor = &H8000000D&
Caption = "請輸入要修改的課程名"
Height = 1695
Left = 240
TabIndex = 0
Top = 120
Width = 5295
Begin VB.CommandButton Command1
Caption = "確定"
Height = 615
Left = 3960
TabIndex = 2
Top = 960
Width = 975
End
Begin VB.TextBox Text1
Height = 735
Left = 240
TabIndex = 1
Top = 480
Width = 2655
End
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "課程名:"
Height = 975
Left = 360
TabIndex = 4
Top = 3120
Width = 1455
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "課程號:"
Height = 975
Left = 360
TabIndex = 3
Top = 2280
Width = 1335
End
Begin VB.Image Image1
Height = 5175
Left = -240
Picture = "Form14.frx":0000
Stretch = -1 'True
Top = -120
Width = 6495
End
End
Attribute VB_Name = "Form10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New ADODB.Connection
Dim mrc As New ADODB.Recordset
Private Sub Command1_Click()
Dim txtsql As String
txtsql = "select * from 課程表 where "
txtsql = txtsql & "課程=" & "'" & Trim(Text1.Text) & "'"
Set mrc = executesql(txtsql)
Text2.Text = mrc.Fields(0)
Text3.Text = mrc.Fields(1)
If Text1.Text = "" Then
MsgBox "請你輸入課程名", , " 信息提示"
End If
End Sub
Public Function executesql(ByVal sql As String) As ADODB.Recordset
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
Dim stokens() As String
stokens = Split(sql)
cnn.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\student.mdb"
If InStr(" INSERT,DELETE,UPDATE", UCase$(stokens(0))) Then
cnn.Execute sql
Else
Set rst = New ADODB.Recordset
rst.Open Trim$(sql), cnn, adOpenKeyset, adLockOptimistic
Set executesql = rst
End If
End Function
Private Sub Command2_Click()
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Command3_Click()
mrc.Fields(0).Value = Text2.Text
mrc.Fields(1).Value = Text3.Text
mrc.Update
End Sub
Private Sub Command4_Click()
Me.Hide
End Sub
Private Sub Form_Load()
connstr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\student.mdb"
conn.Open connstr
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -