So I have gotten my CSV to read into lazarus. I have selected the fields i want to show that all works fine. Now I am working on comparing my CSV file to my SQL DB. To determine what files need to be deleted, which ones are ok, and which ones need to be written up to the DB from the CSV file. So my code works with the delete and the ok. For some reason my write code keeps telling me all 18 lines need to be written onto the SQL DB. I know thats not true cause I hand put in 2 of the information off the CSV file so i could test everything.
This is the code i have right now
For CSVCntr := 0 To Length(CSVList) - 1 Do
Begin
SQLCntr := 0;
While (SQLCntr < Length(SQLList))
and Not (MyWrite (CSVList[CSVCntr],SQLList[SQLCntr]))
do SQLCntr := SQLCntr + 1;
If SQLCntr <= Length(SQLList) Then
Begin
CSVList[CSVCntr].RecStatus:= rsWrite;
WriteCnt := WriteCnt + 1;
end;
end;
This is what i have MyWrite = too
Function MyWrite (InCSVRec, InSQLRec : TCustRec) : Boolean;
Begin
MyWrite := (InSQLRec.LicID = InCSVRec.LicID)
and (InSQLRec.CustID <> InCSVRec.CustID)
and (InSQLRec.Password <> InCSVRec.Password);