I am trying to read a Text file and write into SQL database. I am looping thru all the lines of the text file as follows ...<BR><BR>My recordset.update is outside the loop, because if i encounter any error, i don&#039;t want to update the database. However when i run the program with an error on line number 3 or 4 .... it writes the line number one into database. Why is this happening ??<BR><BR>Please help.<BR>count = 0<BR>while not MyFile.AtEndOfStream<BR> ReadLineTextFile = MyFile.ReadLine <BR> giri= split (ReadLineTextFile,chr(9),32)<BR> ub=ubound (giri)<BR> if ub &#060;&#062; 28 then<BR> Response.Redirect "fileImportErr.asp?err=2" & "&linenum=" & count<BR> end if<BR> rs.AddNew<BR> rs("so")=giri(0)<BR> rs("bol_no")=giri(1)<BR> rs("cust")=giri(3)<BR> rs("fob")=giri(21)<BR> rs("po1")=giri(22)<BR> rs("po2")=giri(23)<BR> rs("po3")=giri(24)<BR> rs("asnreqd")=giri(25)<BR> if not giri(25)="" then<BR> rs("asnupd")= "n"<BR> end if<BR> count=count+1<BR> <BR>wend<BR> rs.Update