Setting Query Parameters at Run Time


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Setting Query Parameters at Run Time

  1. #1
    Austin Guest

    Setting Query Parameters at Run Time


    Thanks to this group of people, I seem to be making some headway on the application
    that I am working on, however, I have found myself struggling, once again,
    with another obstacle.....

    I would like to query my Access97 database at run time from my VB 6.0 application,
    to display only a dynaset of records between two dates that the end user
    will be asked to enter.

    I am not at all adept at coding...and am curious to know if there is an easy
    way to acocmplish this? I hope to report the results on form and on a datareport
    that can be sent to the printer.

    Thanks, once again!!!!

    Austin


  2. #2
    val Guest

    Re: Setting Query Parameters at Run Time


    "Austin" <mis@nysar.com> wrote:
    >
    >Thanks to this group of people, I seem to be making some headway on the

    application
    >that I am working on, however, I have found myself struggling, once again,
    >with another obstacle.....
    >
    >I would like to query my Access97 database at run time from my VB 6.0 application,
    >to display only a dynaset of records between two dates that the end user
    >will be asked to enter.
    >
    >I am not at all adept at coding...and am curious to know if there is an

    easy
    >way to acocmplish this? I hope to report the results on form and on a datareport
    >that can be sent to the printer.
    >
    >Thanks, once again!!!!
    >
    >Austin
    >

    Sorry i didn't read your previouse posts therefore i don't know weather you
    using Dao or Ado. If you using DAO you can use QueryDefs object. There you
    can call your query which you made in access. I suppose you already have
    parameters in query setup. Therefore in QueryDefs you would have to create
    a Parameters Collection. And then execute your query. If you doing this via
    ADO they go with either Connectoin Object or Command Object. If you want
    to query by data between the two dates you can use between keyword in your
    SQL query. ex. "SELECT * FROM <tableName> Where <field> BETWEEN #" & data1
    & "# AND #" & data2 & "#"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center