I have several Delphi programs (XE3), that use a TADOConnection to connect to a MS-SQL Server. I recently checked the connections in the "MS SQL Server Management Studio"'s process list.

  • When the program starts, the connection is inactive, no connection in the server's process list.
  • When I open the connection it's shown in the process list - as expected.
  • When I close the connection (definitely the property "Connected" returns FALSE), the connection is still shown on the servers process list.

On the server the Connection is not closed until I close the program.

Is there a way to close the TADOConnection in a way that really removes the connection on the server without exiting the program?


This is connection pooling; and is a good thing.

But if you really want to hurt performance, you can opt-out of connection pooling features by adding the request to your connection string:

Provider=SQLOLEDB;Data Source=myServerAddress;Initial Catalog=myDataBase;
User ID=myUsername;Password=correct horse battery stapler;OLE DB Services=-2;

These OLE DB Services options are documented on MSDN:

Pooling in the Microsoft Data Access Components (archive)

OLE DB Services  Services enabled
=============== ==================================================
-1 All services (the default)
-2 All services except pooling
-4 All services except pooling and auto-enlistment
-5 All services except client cursor
-6 All services except client cursor and pooling
0 No services

来源:https://stackoverflow.com/questions/48705373/tadoconnection-close-connection-still-active-on-ms-sql-server

TADOConnection.Close - connection still active on MS-SQL server的更多相关文章

  1. (火炬)MS SQL Server数据库案例教程

    (火炬)MS SQL Server数据库案例教程 创建数据库: CREATE DATABASE TDB //数据库名称 ON ( NAME=TDB_dat,//逻辑文件名 在创建数据库完成之后语句中引 ...

  2. Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS(转)

    [-] A What I Am Going To Do B The Setup Steps C Lets Install it   A. What I Am Going To Do B. The Se ...

  3. java连接ms sql server各类问题解析

    首先先来说下使用微软自己开发的架包进行ms sql server数据库的连接时,sql 2000与sql 2005的连接方式略有不同: 1.首先驱动不一样,sql 2000的连接驱动包有三个,分别是: ...

  4. MS SQL Server 数据库连接字符串详解

    MS SQL Server 数据库连接字符串详解 原地址:http://blog.csdn.net/jhhja/article/details/6096565 问题 : 超时时间已到.在从池中获取连接 ...

  5. Datagrip连接SQLServer Connecting DataGrip to MS SQL Server

    Connecting DataGrip to MS SQL Server Posted on June 21, 2016 by Maksim Sobolevskiy Some specific nee ...

  6. Server-side Query interception with MS SQL Server

      up vote15down votefavorite 5 I'm researching into intercepting queries that arrive at the SQL Serv ...

  7. [MS SQL Server]SQL Server如何开启远程访问

    在日常工作中,经常需要连接到远程的MS SQL Server数据库中.当然也经常会出现下面的连接错误. 解决方法: 1. 设置数据库允许远程连接,数据库实例名-->右键--->属性---C ...

  8. Linux下使用FreeTDS访问MS SQL Server 2005数据库(包含C测试源码)

    Linux下使用FreeTDS访问MS SQL Server 2005数据库(包含C测试源码) http://blog.csdn.net/helonsy/article/details/7207497 ...

  9. MS SQL Server中数据表、视图、函数/方法、存储过程是否存在判断及创建

    前言 在操作数据库的时候经常会用到判断数据表.视图.函数/方法.存储过程是否存在,若存在,则需要删除后再重新创建.以下是MS SQL Server中的示例代码. 数据表(Table) 创建数据表的时候 ...

随机推荐

  1. 2-[Mysql]- 初识sql语句

    1.统一字符编码  强调:配置文件中的注释可以有中文,但是配置项中不能出现中文 mysql> \s # 查看字符编码 # 1.在mysql的解压目录下,新建my.ini,然后配置 #mysql5 ...

  2. 41-mysql作业

    1 2 3 4

  3. 【LG3249】[HNOI2016]矿区

    [LG3249][HNOI2016]矿区 题面 洛谷 题解 先平面图转对偶图, 建好了对偶图之后随意拿出一个生成树,以无边界的范围为根. 无边界的范围很好求,用叉积算出有向面积时,算出来是负数的就是无 ...

  4. JAVA基础 XML生成与解析和String包装类下 .replace方法的使用以及char和字符序列的使用场景

    ptLink0.setText(arbu.getPtLink().replace("&","&")); // 如果像 '&','& ...

  5. CSS快速入门-盒子模型

    一.CSS盒子模型概述 css盒子模型 又称框模型 (Box Model) ,包含了元素内容(content).内边距(padding).边框(border).外边距(margin)几个要素. con ...

  6. STM8S——Flash program memory and data EEPROM

    1.简介 STM8S内部的FLASH程序存储器和数据EEPROM是由一组通用寄存器来控制的:所以我们可以通过这些通用寄存器来编程或擦除存储器的内容.设置写保护.或者配置特定的低功耗模式.我们也可以自己 ...

  7. 自定义 vue switch 组件

    <template> <div class="switch clearfix" @click="toggle" v-bind:style=&q ...

  8. docker 一篇文章学习容器化

      什么是镜像?什么是容器?   一句话回答:镜像是类,容器是实例   docker 基本操作命令:   删除所有container: docker rm $(docker ps -a -q)   删 ...

  9. Oracle执行SQL查询语句的步骤

    Oracle执行SQL查询语句的步骤 如果用户在SQL*Plus下输入了如下查询语句:SELECT * FROM dept: 查询语句的处理主要包括三个过程:编译(parse).执行(execute) ...

  10. 第十一次ScrumMeeting博客

    第十一次ScrumMeeting博客 本次会议于11月29日(三)22时整在3公寓725房间召开,持续30分钟. 与会人员:刘畅.辛德泰张安澜.赵奕.方科栋. 1. 每个人的工作(有Issue的内容和 ...