I am working with sql server using ADO provider.
My code uses recordsets and commands to run quries and I fail to understand a basic issue - connections.

In my code, they set a connection string (which is being built in the code, not taken from other ADO element) to the property "connectionString" and call the Open (for recordSet) or Execute (for command) and it seems to work.
My question is who manages the connection? who opens it and closes it?
Does setting connection string to the ADO recordSet / command automatically open a connection? and does calling the Close method automatically close it? Does the SQL server manage it behind the scenes?

The concept is very similar to fstream's open() and close() methods, except ADO uses COM or sockets as underlying file/data transfer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.