Basing a Data Block on a Select Query

I'm trying to create a data block in Forms 6i, based on a from clause
query which I give in the Query Data Source Name Property of the data
block, but when I run the form the fields are blank and even when I
execute the unrestricted query from the forms runtime environment, the
fileds are still not populated and FRM-40505 error is given. Am I
missing some basic stuff here?