My goal is to update a dBase file with updated values extracted from a text file using the &#039;ID&#039; filed as the unique value. If a match isn&#039;t found, I want to add the record to the database. If there is a match, then I just want to update a couple of fields. My problem/question is that I end up with many more records that I should with many of them being blank. So, for example, if the dBase file is empty and I have to add all the contents of the text file as new records (should be 250 of them), I end with a file consisting of approx. 750 records (first 500 or so are blank). What is causing this behavior? Furthermore, is there any way to handle it so that I end up with the correct number of records in the dBase file? Code snippet is listed below. Thanks in advance. <BR><BR><BR>&#039;connect to the database<BR> Set oConn = Server.CreateObject( "ADODB.Connection" )<BR> ConnectString = "Driver={Microsoft Visual FoxPro Driver};" & _<BR> "SourceType=DBF;SourceDB=c:;Exclusive=No;"<BR> oConn.Open ConnectString<BR> <BR> &#039;create the recordset<BR> Set rsGaugeInfo = Server.CreateObject( "ADODB.Recordset" ) <BR> rsGaugeInfo.Open "Select * from USGSdata.DBF", oConn, adOpenStatic, adCmdTable<BR><BR>*** THIS IS ACTUALLY CONTAINED IN A LOOP THAT READS <BR>THE LINES OF TEXT FROM THE TEXT FILE ****<BR>rsGaugeInfo.MoveFirst<BR> Dim criteria<BR> criteria = "ID=&#039;" & gaugeID & "&#039;"<BR> rsGaugeInfo.Find criteria,,,adBookmarkFirst<BR> &#039; &#039;if eof or bof then a match wasn&#039;t found<BR> If (rsGaugeInfo.BOF = True) OR (rsGaugeInfo.EOF = True) Then<BR> response.write "no match" & "&#060;br /&#062;"<BR> &#039;add a record<BR> rsGaugeInfo.AddNew <BR> rsGaugeInfo.Fields("ID")= tmpArray(0)<BR> rsGaugeInfo.Fields("NAME") = tmpArray(1)<BR> rsGaugeInfo.Fields("DATEUPDATE") = arrDateTime(0)<BR> rsGaugeInfo.Fields("TIMEUPDATE") = arrDateTime(1)<BR> rsGaugeInfo.Fields ("GAUGEHT") = tmpArray(3)<BR> Else<BR> response.write "match" & "&#060;br /&#062;"<BR> &#039;the gauge is already in the db, just need to update data <BR> rsGaugeInfo.Fields("DATEUPDATE") = arrDateTime(0)<BR> rsGaugeInfo.Fields("TIMEUPDATE") = arrDateTime(1)<BR> rsGaugeInfo.Fields("GAUGEHT") = tmpArray(3)<BR> End If<BR>**** END LOOP ***<BR>rsGaugeInfo.UpdateBatch<BR>