This statement enables you to add rows of data to the database and provides the same functionality as the ADO AddNew method.
INSERT INTO tablename [(columnname, …)] VALUES (constant, …)
The INSERT INTO statement inserts a single row into the specified table. If the list of column names is not provided, then the column order is assumed to be the order used when the table was created. However, if a table contains a varbinary field, then you must provide a list of column names.
Columns of varbinary type cannot have data inserted into them.
Values for unspecified columns are set to NULL.
Dim rs, i
Set rs = CreateObject("adoce.recordset")
rs.open "create table insertme (a int, b int, c int)"
rs.open "insertme", "", 1, 3
For i = 1 To 15
rs.Addnew "a", i
Next
MsgBox rs.recordcount
rs.Close
rs.open "insert into insertme (a, b, c) values (101, 102, 103)"
rs.open "insert into insertme (a) values (100)"
MsgBox "records added"
rs.open "insertme"
MsgBox rs.recordcount
rs.Close
rs.open "drop table insertme"
Set rs = Nothing