Listview控件有10列N条数据,怎么一起保存进数据库呀,求助
因为要存入的数据表不是固定的,导入的数据列数也是不固定的,所以想动态的存入数据库,怎么写都不对,到第三列的时候就自动换行了。Dim j As Integer
Call OpenConn
Sql = "select * from " & & ""
rs.Open Sql, cn, 1, 3
j = 1
rs.AddNew
For i = 1 To Me.ListView1.ListItems.Count '×üDDêy
For j = 1 To Me.ListView1.ColumnHeaders.Count
rs.Fields(1).Value = ListView1.ListItems.Item(i)
rs.Fields(j + 1).Value = ListView1.ListItems.Item(i).SubItems(j)
Next j
Next i
rs.Update
Call CloseConn