Results 1 to 9 of 9
  1. #1
    cohagan
    Guest

    Invisible Queries!?

    We have an Access 2000 database converted from an Access 97 database. The Access 97 database has lots of queries, but the Access 2000 database shows NONE of them. They are there, however, since I can access them via a VB program and DAO. Anybody got any ideas to make these invisible queries rematerialize in the query view?

    Thanks in advance,
    Bill Cohagan

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Invisible Queries!?

    Do you have the hidden objects showing? If not, go to Tools-->Options-->View and turn on hidden objects. See if that makes them visible. It is possible to create a true hidden query, but it shouldn't have happened in a conversion.
    Charlotte

  3. #3
    cohagan
    Guest

    Re: Invisible Queries!?

    Charlotte-
    Thanks for the response. Yes, I do have hidden objects (and system objects) showing enabled. Interestingly all of my queries are listed in the MsysObjects table.
    The only unique thing about these queries is that they were generated by a VB program and have an attribute that "normal" queries don't have -- although I actually think there are some hand crafted queries that are invisible as well.

    Bill

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Invisible Queries!?

    The only was I know of to make a query truly invisible without setting the vbHiddenObject attribute (you don't want to do that, by the way) is to create them from code. I don't know of any way to make them visible after that.
    Charlotte

  5. #5
    cohagan
    Guest

    Re: Invisible Queries!?

    Charlotte-
    Are you saying that creating a query from code will make it invisible? I've created hundreds of queries from code and until now have never had one turn invisible. Is this something new to Access 2000? Can you be more specific about what causes a code created query to be (or become) invisible?

    Thanks again,
    Bill

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Invisible Queries!?

    No, I'm saying that the only way I know of to create an invisible query is from code. You can do it like this using ADO:

    <pre> ' Open the Catalog object on the current database.
    catDB.ActiveConnection = CurrentProject.Connection

    'Create a Command object to contain the
    'query's definition.
    Set cmd = New ADODB.Command

    cmd.CommandText = strSQL

    'Add the query to the Procedures collection.
    catDB.Procedures.Append strQryName, cmd</pre>


    You will now have a query that exists and can be used in code, but it does not appear in the Queries tab in the database window in an MDB.
    Charlotte

  7. #7
    cohagan
    Guest

    Re: Invisible Queries!?

    Is there a DAO equivalent way to do this? I created these queries via DAO. Since I'm not (yet) an ADO user I'm afraid I don't understand why your example produces invisible queries rather than visible ones.

    Regards,
    Bill

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Invisible Queries!?

    I think the reason they're invisible when created that way may be because an MDB doesn't have a visible procedures collection, only a queries collection. I'll have to think about it, but I don't know off-hand of a way to do it in DAO.
    Charlotte

  9. #9
    cohagan
    Guest

    Re: Invisible Queries!?

    Thanks. No need to pursue the DAO variant. I was just trying to understand what was going on -- and your comment distinguishing the procedures from the queries collection explains it for me.

    Any ideas at all as to how I might salvage these easily? (By the way, extracting them via code and moving them over to a new database via code doesn't cure the problem.)

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •