539 バイト追加
、 2020年2月15日 (土) 07:30
==Access VBA レコードの挿入==
Access 2000
Public Sub insertData()
Dim conn As ADODB.Connection
Dim rec As ADODB.Recordset
Set conn = CurrentProject.Connection
Set rec = New ADODB.Recordset
Call rec.Open("NewTableName", conn, adOpenKeyset, adLockOptimistic)
rec.AddNew
rec("Field01") = "aaaa"
rec("Field02") = "bbbb"
rec("Field03") = "cccc"
rec.Update
rec.Close
conn.Close
Set rec = Nothing
Set conn = Nothing
End Sub