Access Update & Loop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harshakusam
    New Member
    • Apr 2009
    • 36

    Access Update & Loop

    1)
    Is there any way to update the data in this table(MSysQueri es). I have a bunch of passthrough queries where I need to update the ODBC connection.Inst ead of updating the properties in each query individually, is there any way to do an update to that data in the MSysQueries table.

    I need to update NAME1 Column

    Code:
    SELECT MSysQueries.Name1
    FROM MSysQueries
    WHERE (((MSysQueries.Attribute)=1));
    2)
    Code:
     
    SELECT MSysObjects.Name
    FROM MSysObjects
    WHERE (((MSysObjects.Type)=5));
    From above sql i will get list of queries in my MDB file

    Assume Output of above query is
    abc
    xyz
    lmn

    I have to put the above values 1 by one in below ??
    Code:
      
    DoCmd.OutputTo acOutputQuery, [B]"??"[/B],acFormatXLS, [B]"D:\??"[/B]
    
    [U][B]Example[/B][/U]
    
    DoCmd.OutputTo acOutputQuery, [B]"abc"[/B],acFormatXLS, [B]"D:\abc"[/B]
    DoCmd.OutputTo acOutputQuery, [B]"xyz"[/B],acFormatXLS, [B]"D:\xyz"[/B]
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32666

    #2
    If you are able to update the data in this table then surely there is clearly no issue with you writing code to loop through the values returned and outputting the objects whose names are returned.

    To be honest I'm not sure what you're asking here. The question makes very little sense as a question.

    What do you actually want to know?

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32666

      #3
      Another question would be :
      What are you actually trying to do?

      This seems a complicated way of going about finding a list of objects. There are generally better methods for this, depending on exactly what you want of course, which is far from clear.

      Comment

      • harshakusam
        New Member
        • Apr 2009
        • 36

        #4
        Sorry to all Problem is now resolved.. Thanks to all

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32666

          #5
          In case anyone is interested, it seems the answer was found in another (duplicate) thread (How to loop & substitute ???).

          Comment

          Working...