That query would only be legal if *BOTH* of the following applied:
str = "insert into Table1 values(" & code & "," & Name & ")"
(a) Your TABLE1 has only two fields in it.
(b) Those two fields are *BOTH* numeric fields. That is, they will never hold text values, only numeric data.
[Well, not quite true. You *could* have three fields in the table *if* one of the fields is an autoincrement field.]
*PROBABLY* your query needs to look like this:
where you replace field1 and field2 with the actual names of the fields.
str = "insert into Table1 (field1, field2) values(" & code & ",'" & Name & "')"
And if field1 (the field that will receive the code value) is NOT numeric, then you would need apostrophes around code as well, thus:
Though this would work, it is *NOT* the best way to create and use queries in VB.NET and ADO.NET. You really need to go look at how to create parameterized queries with the OleDbCommand object and start using them.
str = "insert into Table1 (field1, field2) values('" & code & "','" & Name & "')"