Query vs Table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zelalem
    New Member
    • Nov 2006
    • 19

    Query vs Table

    Hi...

    The back end of my application program is done with Ms access 2002 and the front end is in VB.6. In my database there are various queries. I know that query is another object of the database as table is. But what i want to do is that, just to deal with diffrent queries in the same way as i do on tables pataining to the interface. Is that possible ?, please...
  • sashi
    Recognized Expert Top Contributor
    • Jun 2006
    • 1749

    #2
    Originally posted by Zelalem
    Hi...

    The back end of my application program is done with Ms access 2002 and the front end is in VB.6. In my database there are various queries. I know that query is another object of the database as table is. But what i want to do is that, just to deal with diffrent queries in the same way as i do on tables pataining to the interface. Is that possible ?, please...
    Hi there,

    Yes, it's possible, you can call ready made query instead of passing SQL statement as usually done. You just have make some minor adjustments to recordset object and everything should work fine, just like magic. Good luck & Take care.

    Comment

    • Zelalem
      New Member
      • Nov 2006
      • 19

      #3
      Originally posted by sashi
      Hi there,

      Yes, it's possible, you can call ready made query instead of passing SQL statement as usually done. You just have make some minor adjustments to recordset object and everything should work fine, just like magic. Good luck & Take care.



      Thank you for your reply.
      Would give me any hint regarding the adjustments to the recordset?

      Comment

      • willakawill
        Top Contributor
        • Oct 2006
        • 1646

        #4
        Originally posted by Zelalem
        Thank you for your reply.
        Would give me any hint regarding the adjustments to the recordset?
        Hi. Take a look at each query in access. Change the view to sql. copy and paste this code into your vb app and change it to a string. Use this string as the source of your recordset. This is the easiest way I know of using a query in access.

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by willakawill
          Hi. Take a look at each query in access. Change the view to sql. copy and paste this code into your vb app and change it to a string. Use this string as the source of your recordset. This is the easiest way I know of using a query in access.
          Can't you just specify the query name in your code, instead of the SQL?

          Comment

          • willakawill
            Top Contributor
            • Oct 2006
            • 1646

            #6
            Originally posted by Killer42
            Can't you just specify the query name in your code, instead of the SQL?
            Bad idea. Some drivers don't work with access queries. Much better to put the query in your code as an sql statement and keep it portable.

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              Originally posted by willakawill
              Bad idea. Some drivers don't work with access queries. Much better to put the query in your code as an sql statement and keep it portable.
              Thanks, I'll keep that in mind.

              Comment

              Working...