Atozed Forums

Full Version: Strange behavior with SA HTTPSYS and ADOConnection
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Guys,

Trying the SA HTTPSYS option, it seem to work nicely. I have a small test application with one form with a iwlistbox on it and 2 iwlabels. Added a datamodule on which there is an ADOConnection and a ADOTable. In the onformshow of the form, I open the table and add each row to the listbox. In the iwlabel1 I show the result of GetCurrentUser (windows unit) and the other label I just fill caption with a text.

When running as visible appl, it works fine. The strange behavior is that it lists the contenct of the table even though I have not specifically ticked the CONNECT box on the ADOConnection properties, notr do I call its Open method. I do call ADOtable.open before retrieving each row.

How can it be it can open the table when I have not opened the connection yet ?

The ADOconnection is build with MSSQL server name, Windows auuthentication and the name of the database, and the tablename of the ADOTable is set to the name of the table, so all is there, but the CONNECT command. Is there an autoconnect I miss somewhere ?
If you open the ADO table explicitly, it will also open the underlying ADO connection if not connected.

This is normal and expected.

BTW, it is better to use ADOQuery components because you can retrieve only the used fields and records and not the whole table. Also, if you are loading the DataSet content and don't intend to use it again, it is a good practice to open the DataSet, use it (i.e. load the records into the list box) and close it in one single operation.