this is driving me batty! i'm reading in a .csv file and then inserting the data into a mssql db. batchid sometimes shows up blank. the values that are disappearing begin with the letter "N", such as "NP2338" or "N00312". outside of those that begin with "N", the rest are a five digit number. the table field is varchar. why is it dropping those that begin with "N"?
edit: the csv doesn't have any blanks in those fields btw...
Code:for i = 1 to ubound(arrData,2) if not isnull(arrData(3,i)) and trim(arrData(3,i)) <> "" then gname = replace(trim(arrData(3,i)),"'", "''") else gname = "-" end if if not isnull(arrData(4,i)) and trim(arrData(4,i)) <> "" then idesc = replace(trim(arrData(4,i)),"'", "''") else idesc = "-" end if batchid = arrData(1,i) grpid = arrData(2,i) iSQL = "insert into mytable (eDate, Batch, GroupID, GroupName, ItemDescription, Received, Accepted, UnitValue, ExtValue, NoRejected, DateImported) values ('" & arrData(0,i) & "', '" & batchid & "', '" & grpid & "', '" & gname & "', '" & idesc & "', '" & arrData(5,i) & "', '" & arrData(6,i) & "', '" & arrData(7,i) & "', '" & arrData(8,i) & "', '" & arrData(9,i) & "', '" & Now() & "');" '//response.write isql & "<br>" objConn.Execute(iSQL) next





Bookmarks