Batch Queries.

I have a VB application that uses an Access 2003 database. The database is located on a shared drive on the server. I am running into the problem that it takes an extremely long time to load information into text boxes that I am using. I believe the problem to be that I need to run about 27 separate queries to get the information that I need.

Is there any code that will allow me to batch these queries so that I don't need to open the database, run the query, close the database, and repeat.

As always, any help is appreciated.



Answer this question

Batch Queries.

  • forrestcupp

    Hi,

    You could maybe just open the database the once and close it once.

    This idea may speed things up.

    Look at using the sql UNION command if you have exported the database to an SQL server.

     

    Regards,

    S_DS

     



  • vzzvzz

    Well, that's the problem, when I open the database, I can't seem to use any additional queries. It gives the the following error:

    can not change command while database is open (paraphrased)

    I will look at the union command. Thanks.


  • Allen Razdow

    I actually figured out a way to get it to work (well, at least faster than it was anyways).

    I create a Union query in the database to get all of the information that I needed. Then I used a Select query in VB and a data reader to get the information I needed.

    Thanks to all for the help (i couldn't have done it without the myriad of posts in this and other forums that lead me to this answer...even it wasn't the direct route)


  • Batch Queries.