Access VBA レコードの挿入
ナビゲーションに移動
検索に移動
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
© 2006 矢木浩人