DataSnap a nd workflow

Are you using TWorkflowDBXDB? It creates an TSQLQuery internally, not TQuery.