ODBC opening

I've written an application that use a ODBC database.
The program works fine, but there is a little problem :

The first time I open the DB wiht DB.Open(), this opening takes a long time.
After if I do a DB.Close() and reopen the DB, it is immediate.

Does someone know where comes the problem from and how to solve it ?

Who is Participating?
chensuConnect With a Mentor Commented:
After opening and closing, it is cached. It will be much faster next time it is reopened since the system accesses it from the cache. It is reasonable if it does not take too long for the first time.
Its just a matter of caching.
moktarAuthor Commented:
There is not a way to make the first opening faster ?

Because my program works in real time, so the first request slows the execution.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

You may open and close it before the first time you really want to access it.
moktarAuthor Commented:
Well, if it is the only way, I will try this.

But if it takes the datas from the cache, should I do a Requery after the openeing or is it done automatically?
It depends on the system implementation. Normally the opening takes much time and the system should caches the important information for you. You may not need to do a query.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.