|
TOCIDatabase show login dialog, but TOCIQuery.Active = False and TOCIDatabase.Connected = False ... |
|
|
|
|
Sep 19, 2006 |
I create simple application: DM with TOCIDatabase, Form with TOCIQuery. In first time i set TOCIDatabase.Connected = False. Then i open TOCIQuery and close it, after that made TOCIDatabase.Connected = False. And save project. Now when i open Form, TOCIDatabase show login dialog, but TOCIQuery.Active = False and TOCIDatabase.Connected = False ! What is wrong ?
TOCIQuery has two properties: Active and Prepared. Active = True - dataset is open. Prepared = True - SQL query is prepared. When you makes Active = True, then Prepared = True becomes also. To have Prepared = True, TOCIDatabase must be connected. So, you simply have Prepared = True. It is why, when you open Form TOCIDatabase starts login dialog. Simply turn off TOCIQuery.Prepared property. |