Link to home
Start Free TrialLog in
Avatar of Claude LEC
Claude LEC

asked on

DELPHI Open ACCESS DB twice

Hi
I havean ACCES DB with Delphi. I open the Db from a Ā menuline open DB. The I have a menuline to close de DB. So I can use different DB for each year.
When I run my software from delphi (execute) it run properly but when i close the Database and without to return to Delphi, if I trie to open it again, I have nothing in my Different db grid. So it seems that it is not open but I haven't any error mesage just blank dbgrid an d DBtext component.
Any idee? Beacause if I close le DataBase and reopen it again it schould work.
Regards
Claude
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

You should use AdoConnection as a main connection component. All other Ado (query, dataset) components let use this main AdoConnection.
So, if you open AdoConnection - all other dataset components can reuse this db connection. When you close AdoConnection - you can - changing connection string use another database ....
Look at this old EE question for an example.
the code ... it's in the code !
without showing the code ... not much we can do
Avatar of Claude LEC
Claude LEC

ASKER

Hi
Thanks, i find out the problem! I have a DataControl modul with all my tables, Dataset etc. And I did not free the modul by closing the Database. So das was the problem
Yes in the code!!.Always a good logic exercice
Thank you very much for your reply
<Claude
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.