INFO: ????? ????? ????? ??????? ?? ????? ODBC

?????? ????????? ?????? ?????????
???? ???????: 164221 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

???? ??? ??????? ????? ????? ????? ??????? ?? ??? ??????? ODBC.

??????? ????

Microsoft ODBC ??????? 3.0 ????? ??????? ????? ?????????.
???? ????????? ?????? ??? ??????? ODBC ?????? ??????
??????? ?? ???? ???? ?? ????? ??????? ODBC ????????
???? ????? ????? ????? ?? ????? ????.

??? ??? ??????? ODBC ???? ????? ? ??? ??? ???????
??? ???? ????? ?? ?????? ??? ???????. ???? ??? ??????? ?????
?? ?????? ????? ??? ????? CPTimeout ?????? ????? ODBC. ???
?????? ???? ? ????? ??????? ?? ?????? ?? ??????. ODBC
???? ??????? ??????? SQLConfigDriver ?????? ???? CPTimeout ? ???
??? ????? ?????? ??? ???? ????????? ODBC ???? ?????? ?????? ????? ODBC ??????.

?????? ?????????? CPTimeout 60 ?????. ???? ????????? ???? ???? ??? ??? ??????? ODBC ??? Microsoft Internet
???? ??????? ??????? (??? ???? ??????) ? ??? ??????? ???? ?????. Microsoft
???? ??????? ?????? (IIS) ??????? 3.0 ?? ????? ?????? ?????? (ASP)
?????? ?? ???? ?????????. ????? ????? ????? ??????? ??
IIS ?????????? ?? ???? ????? ???? StartConnectionPool ??? 1. ???? StartConnectionPool ???:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\ASP\Parameters
???? ??????? ??? ??????? ODBC SQLSetEnvAttr ????? ????? ???????. ??????? ???? ?? ????? ????? ????? ??????? ?? ??? ??????? ODBC:
   #include <windows.h>
   #include <stdio.h>
   #include <sql.h>
   #include <sqlext.h>

   void main()
   {
   SQLHENV   henv;
   SQLHDBC   hdbc;
   int       i=0;

   if (!SQL_SUCCEEDED(SQLSetEnvAttr(
      NULL,  // make process level cursor pooling
      SQL_ATTR_CONNECTION_POOLING,
      (SQLPOINTER)SQL_CP_ONE_PER_DRIVER,
      SQL_IS_INTEGER)))
   printf("SQLSetEnvAttr/SQL_ATTR_CONNECTION_POOLING error\n");

   if (!SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_ENV, NULL, &henv)))
      printf("SQLAllocHandle error\n");

   // set the ODBC behavior version.
   if (!SQL_SUCCEEDED(SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION,
   (SQLPOINTER) SQL_OV_ODBC2, SQL_IS_INTEGER)))
      printf("SQLSetEnvAttr/SQL_ATTR_ODBC_VERSION error\n");

   //set the matching condition for using an existing connection in the
   pool
   if (!SQL_SUCCEEDED(SQLSetEnvAttr(henv, SQL_ATTR_CP_MATCH,
   (SQLPOINTER) SQL_CP_RELAXED_MATCH, SQL_IS_INTEGER)))
   printf("SQLSetEnvAttr/SQL_ATTR_CP_MATCH error\n");

while (i < 10) {
   if (!SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_DBC,
      henv, &hdbc)))
      printf("SQLAllocHandle error\n");
      if (!SQL_SUCCEEDED(SQLConnect(hdbc,
   (unsigned char*)"testing\0", SQL_NTS,
      (unsigned char*)"sa\0", SQL_NTS,
   (unsigned char*)"\0", SQL_NTS)))
      printf("SQLConnect error\n");
   else
      printf("Connect successfully %d times\n", i);
   //the first time, the application calls SQLDisconenct, it will return
                 //the connection to the //pool
   SQLDisconnect(hdbc);

   if (!SQL_SUCCEEDED(SQLFreeHandle(SQL_HANDLE_DBC, hdbc)))
      printf("SQLFreeHandle error\n");
   i++;
   }
   SQLFreeHandle(SQL_HANDLE_ENV, henv);
   }
				
??????? ODBC ??? ??????? SQLDisconnect ???? ?????, ??? ??? ??????? ??? ??????. ???? ????? ??????? ?? ??????? SQLConnect/SQLDisconnect ???? ????? ??? ???????? ??? ?????.

???????

???? ???????: 164221 - ????? ??? ??????: 05/???? ??????/1421 - ??????: 1.0
????? ???
  • Microsoft Open Database Connectivity 3.0
????? ??????: 
kbmt kbinfo kbprogramming KB164221 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????164221
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com