Using delphi 4 and ADO Dataset, I am trying to create a sql statement in a ADO query I am creating. The sql string that I pass is too long I believe and I get the mentioned error.
I have 20000 records in an Access db. I need to display in a grid only the records that match user's search criteria. I get the records matching the search, I create a buffer string with the index (i.e. "123123,312312,3213322,...") and add this buffer to the sql string of the query, using the "in" command. something like this
Q.SQL.Add('Select * from Listings');
Q.SQL.Add('Where iListingIndex IN (' + bufferstring + ')');
this works fine with a small dataset. but with such a large dataset the string cuts off or i get the error mentioned.
Please help!!! I was thinking of using Params, but never used it before.