以下是调用代码段: Dim arrSQL As New ArrDictionary arrSQL.Add(\"收件号\", objExcelSheet.Cells(t, 1).Value) arrSQL.Add(\"房屋地址\", objExcelSheet.Cells(t, 2).Value) arrSQL.Add(\"建筑面积\", objExcelSheet.Cells(t, 3).Value) arrSQL.Add(\"房型\", objExcelSheet.Cells(t, 4).Value) arrSQL.Add(\"朝向\", objExcelSheet.Cells(t, 5).Value) arrSQL.Add(\"楼层\", objExcelSheet.Cells(t, 6).Value) arrSQL.Add(\"产别\", objExcelSheet.Cells(t, 7).Value) arrSQL.Add(\"金额\", objExcelSheet.Cells(t, 8).Value) arrSQL.Add(\"区域\", objExcelSheet.Cells(t, 9).Value) arrSQL.Add(\"竣工日期\", objExcelSheet.Cells(t, 10).Value) arrSQL.Add(\"使用年限\", objExcelSheet.Cells(t, 11).Value) arrSQL.Add(\"联系人\", objExcelSheet.Cells(t, 12).Value) arrSQL.Add(\"录入人\", objExcelSheet.Cells(t, 13).Value) arrSQL.Add(\"录入日期\", objExcelSheet.Cells(t, 14).Value) arrSQL.Add(\"所属分店\", objExcelSheet.Cells(t, 15).Value) '组合字段名 Dim ColumnSQL As String '组合字段值 Dim ValueSQL As String For i As Integer = 1 To arrSQL.i ColumnSQL += arrSQL.Item(i).Key.ToString & \",\" ValueSQL += \"'\" & arrSQL.Item(i).Value.ToString & \"',\" Next '组合SQL语句 objCom.CommandText = \"insert into content(\" & ColumnSQL & \")\" & _ \"values(\" & ValueSQL & \")\" ColumnSQL = \"\" ValueSQL = \"\" arrSQL = Nothing |