Page 1 of 1

Problem/info about TMSConnection and ConnectionString property

Posted: Fri 18 Apr 2008 15:04
by Sergio Bertolotti
Dear Support,

I use last version of SDAC 4.35.1.16 prof. with Delphi 2007 with last service pack.

I have this problem / question.

I use TMSConnection component. I set connectionString at designtime and all is OK.
I set options - KeepDesignConnected to false in TMSConnection component.
I connect a TMSQuery to this TMSConnection. After this I close my TMSConnection with method Disconnect.

When I open my TMSQuery, itself open my TMSConnection.

If I set connectionString := '' and open my TMSQuery at this point I can't open Connection and I obtain an error message.

At this point my question is : is it normal this behavior ?

How can I disconnect from my DB TMSConnection component ?

Best regards.

Sergio Bertolotti

Posted: Mon 21 Apr 2008 09:31
by Antaeus
You can disconnect using one of the following lines:

Code: Select all

  MSConnection.Disconnect;
  MSConnection.Close;
  MSConnection.Connected := False;
The KeepDesignConnected option has no sense at run time.
Setting the ConnectionString to an empty string just clears connection setting.

When you are trying to open a TMSQuery component linked to this connection, the connection automatically gets connected.

Posted: Tue 22 Apr 2008 10:06
by Sergio Bertolotti
Dear Antaeus,

many thank's for your answer.

Best regards.

Sergio Bertolotti