Passing querys to dlls

I am passing a query to a DLL (Don't ask why political reasons). I can
change the SQL and run it with no problems. I can see the correct result
sets in a grid and get a recordcount off of the query and connect it to a
rebortbuilder report and view and print it.
However if I try to scroll the records in the grid I get an access
violation message and the whole things dies. If I try to attach the query
as the source to a Batcmove and  execute the Batchmove I get the message
that I cannot assign a tFieldDefs to a tFieldDefs and everthing dies. Any

I am using Delphi 4 pack 3 and get the same results querying local data or