?? 添加動態數據.frm
字號:
VERSION 5.00
Begin VB.Form 添加動態數據
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
End
Attribute VB_Name = "添加動態數據"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Attribute cmd.VB_VarHelpID = -1
Private Sub Form_Load()
Dim par2(12) As String
Dim i As Integer
'打開數據庫
Set cn = New ADODB.Connection
Set cmd = New ADODB.Command
cn.ConnectionString = "DSN=student" '設定數據源名稱為student
cn.Open
'動態存儲數據
For i = 1 To 9 Step 1
par2(i) = "Jose" & i & ""
strSQL = "INSERT INTO Customers (FirstName, LastName) VALUES ('" & par2(i) & "','" & par2(i) & "')"
cn.Execute (strSQL)
Next i
cn.Close
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -