View Full Version : Query objects


KenHigg
05-29-2008, 04:48 AM
In the MSysObjects table there are query objects with names that start with a tilde (~). Does anyone know where they come from and what it is for?

Example:
~sq_cfrmAdminOptions~sq_cChild19

boblarson
05-29-2008, 05:11 AM
I believe that is from queries you build in VBA (I could be wrong) and have run.

DCrake
05-29-2008, 05:15 AM
These are objects that have changed during the current session. They could be deleted files, simply anything. When you run a compact and repair it attempts to resolve the issues and if done it deletes them from the sysobejcts file.

For example, and you can try this, create a new table nothing special. Next delete it. Next press Ctrl+Z to restore the table. Ie undelete it. If Access did not store the details of the table int he sysobjects table it would not know how to undelete it. By prefixing it with a tilde ~ it knows that this is a significant file.

No doubt other users will have input on this

CodeMaster::cool:

KenHigg
05-29-2008, 05:53 AM
Hum... Odd. It saves some objects that are not queries as a type 5 which is what query types are...

Anyway, I see how they work, just not why - :)

Thanks.

wazz
06-08-2008, 05:25 AM
"...the SQL used for the row source of a form or control when it has not been expressly saved and named..."
http://www.databasejournal.com/features/msaccess/article.php/3528491

gemma-the-husky
06-08-2008, 01:17 PM
i thought a ~ was also used to indicate a deleted object, until you did a compact etc, when they are physically deleted.

similar to the way windows files are flagged for deletion