bryan 0

bryan 0

  • NA
  • 9
  • 0

INSERTING data into specific fields of a table

May 6 2005 2:46 AM
what abt if i wanna insert data to only fldLength and fldSize (fields) of the table, Table1, how do i choose to insert into the specific fields? Table1: fldID fldName fldLength fldSize fldExt ps: do i need to .update() or acceptchanges() for the above codes? my current codes are: cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb;") cn.Open() For each filename In filelist str = "insert into table1 values('" & filename.name & "','" & "99" & "')" cmd = New OleDbCommand(str, cn) cmd.ExecuteNonQuery() Next For each filename In filelist str = "insert into table2 values('" & filename.Extension & "','" & filename.Length & "')" cmd = New OleDbCommand(str, cn) cmd.ExecuteNonQuery() Next cn.Close()

Answers (1)