Board index » delphi » Error: "Mult records found, but only one was expected"
Wed, 18 Jun 1902 08:00:00 GMT
Error: "Mult records found, but only one was expected"
I'm looping/reading through a text file and adding records to SQL tables as
I go. I get the error message: "Mult records found, but only one was
expected". This happens multiple times. I've fixed one by skipping the
record and moving on (obviously, not the most ideal solution). I fixed
another by truncating the variable assigned to a field to the field length
(this should happen automatically?). The error message occurs during the
post as in the following sample:
Query1Description.AsString := sDesc;
The SQL table behind it is really just that simple. It has 2 fields(KEY
and DESCRIPTION). KEY as autoincremented in the database. As I mentioned
before, if sDesc is longer than the width of the DESCRIPTION field, I get
the error. I fixed that and now the error occurs later.
This is a real hair-puller for me.