Wednesday, April 6, 2011

Ms-Access Query is getting deleted automatically. What can be the reason?

Some of the queries I have written inside MS-Access are getting deleted automatically. And while I run the queries through code, I get this error

'Query should have one destination field'

What can be the possible reason

Explanation: I created a query in MS-access. Ran it from the code. Closed the database. Started it again, and now for that particular query, it is showing 'SELECT ;' only. Strange. I am in panic mode now

From stackoverflow
  • Check if your query actually has any fields in the query design grid. When you open the query in design view, you will most likely notice it doesn't.

    Varun Mahajan : It did have fields initially. Does it make any difference if I am using * instead of writing all field names?
    tehvan : * should be fine, as it contains at least one field (provided your tables/queries are not all empty).
  • Does the query stick around when you don't run the code (but still close and reopen the database)?

    If so, I would suspect that something in your code is overwriting the query.

0 comments:

Post a Comment