FIX: ???? ??????? ?? ?????? ????? ODBC Jet ?? SQL_NUMERIC ?? ???????? SQL_C_BINARY

?????? ????????? ?????? ?????????
???? ???????: 273772 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

???????

??? ??????? ???? SQLBindParameter ?? ?????? ????? ODBC Jet ?????? ????? ??? ?????? SQL SQL_NUMERIC ?? ??? ??? SQL_C_BINARY SQL_WCHAR ???? ???? ???????.

??? ??? ?????? "????? ??????" (PerfMon) ??????? ????? ?????? ?????? ?? ????? ???? ????? ????????? ???? ???? ????? ? ?? ??? ????? ??????? ??? ????? ??????? ?? ??????.

?????

??? ??????? ??????? ??????? ??? ?????? ????? ODBC Jet ???????? ?? ????? ????? ???????? ??????? ODBC ??? ????? ???????? ??????? ?? ???? ????? ?????? Jet. ??? ??????? ??? ??? ??????? ??????? ???? ?????? ???????? ??? ???? ????? ???? ?? ?????? ??????? (IPDs).

???? ????? ???????? ???????? ??????? ??? ??? ?????? ?????? ????? ?????? ???? ????? ???? ?? reuses ?????? ?????? ?? ??? ??? ???????. ??? ???? ??? ????? ??? ?????? SQL_NUMERIC ?? ??? ??? SQL_C_BINARY SQL_WCHAR ????? ??????? ??????? ???? ????? ?????? ??? ?????? ????? ?? ??? ??????? ??? ?????? ???????.

????

?? ????? ??? ??????? ?? ???? ??? ?????? ?? Windows 2000 ? MDAC 2.5.
  • ??? ??? ???????? ??? ?????? ??? ???? ???? ???? ????? ??????? Windows 2000. ?????? ??? ??????? ??????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
    260910????? ?????? ??? ???? ???? ???? ??????? Windows 2000
  • ??? ??? ???????? ??? ?????? ??? ???? ???? ???? ?? Microsoft ?????? Access ?????? 2.5. ?????? ??? ??????? ??????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
    293312INFO: ????? ?????? ??? ???? MDAC 2.5 ???? ???????
??? ?? ???? ?????? ?????????? ?? ??? ??????? ???? ??????? ??????? ?? ????:
   Date        Version       Size              File name    
   ---------------------------------------------------------------------
   09/13/00    4.0.5708.0    270,608 bytes    Odbcjt32.dll
   09/14/00    1.10.101.0    295,696 bytes    Q273772_W2K_SP2_x86_en.EXE
				
??????: ????? ??? ??????? ?????? Microsoft Data Access Components (MDAC) 2.5 ?????? ????? ?????? Service Pack 1 (SP1) ?? ??????? ???? ????? ???????? ??? ??????? ?????? ?? MDAC 2.5 ?????? ????? ?????? SP1. ?? ???? ?? ????? ????? ????? ????? ?????? ??? MDAC 2.5.

?????? ??? ??????? ?????? ??? ?????? ????? ???? ??????? Microsoft Windows 2000 ?? ?????? ???? ???? ??????? ?????? (Q273772_W2K_SP2_x86_en.EXE). ??? ????? ?? ??????? ?????? ???? ??? ???????? ??? ?????? ???????, ???? ???? ??????? ?????? ???? ??????? ??? ??? ??????? ???????? Windows 2000 ???? ??? ???? ??? ???? ??????? Microsoft Windows NT 4.0 ?? ???? ??????? Microsoft Windows 95 ?? Microsoft Windows 98 ??????? ????????. ????? MDAC ??? ???? ??? ????? ????? ?? ????? ??????? ??? ??????? ??? ?????? ???? ??????? ???? ????? ?????? ??? Windows 2000. ??? ????? ??? ??????? ?????? ????? ????? ???? ????? ??? ??? ????? ??????? ??? ??????? ???????? Windows NT 4.0 ?? Windows 95 ?? Windows 98.


???? ??????

?? ???? ?? ?? ???? ???? ???????.

?????

???? Microsoft ?? ??? ????? ?? ?????? Microsoft ??????? ?? ????? ??? ???????. ?? ????? ??? ??????? ???? ??? ?? Microsoft ?????? Access ?????? 2.5 ?????? ????? ?????? Service Pack 2 "?" Microsoft Windows 2000 Service Pack 2.

??????? ????

?? ??? ??????? ???????? ???? ???? ????? ????? ????? ????? ?????? ??? ????????? 0x100000 (1048576) ?????? ????? ????. ??? ????? ????? ???????, ??????? ?????? ???? ??????? ???? ?? ????????? (???? ?????) ?? ???.

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

  1. ?? ???? ???????? ???????? ???? ?? ????? ???? ???? Microsoft Visual C++ ?? ?? ????? ????????? ????????. ?????? ?????? ?? ????? ??? ????? ??? ???? ?????? ???? ?????? ????? ????.
    #include <windows.h>
    #include <sql.h>
    #include <sqlext.h>
    #include <tchar.h>
    #include <stdlib.h>
    #include <stdio.h>
    
    
    #define LEAK_NUMERIC 1		//Use this to determine NUMERIC or BINARY leak
    
    
    void HandleError(SQLHANDLE	hHandle, SQLSMALLINT hType, RETCODE RetCode)
    {
    	SQLSMALLINT	iRec = 0;
    	SQLINTEGER	iError;
    	TCHAR		szMessage[1000];
    	TCHAR		szState[SQL_SQLSTATE_SIZE];
    
    
    	if (RetCode == SQL_INVALID_HANDLE)
    	{
    		fprintf(stderr,"Invalid handle!\n");
    		return;
    	}
    
    	while (SQLGetDiagRec(hType,
    			 hHandle,
    			 ++iRec,
    			 (SQLCHAR *)szState,
    			 &iError,
    			 (SQLCHAR *)szMessage,
    			 (SQLSMALLINT)(sizeof(szMessage) / sizeof(TCHAR)),
    			 (SQLSMALLINT *)NULL) == SQL_SUCCESS)
    	{
    		fprintf(stderr,TEXT("[%5.5s] %s (%d)\n"),szState,szMessage,iError);
    	}
    
    }
    
    
    char* szConnStringIn = "Driver={Microsoft Access Driver (*.mdb)};DBQ=E:\\JetLeak\\TestDatabase.mdb";
    char* szDropTable = "DROP TABLE LeakTable";
    //char* szInsertStatement = "INSERT INTO LeakTable VALUES (?)";
    char* szSelectStatement = "SELECT * FROM LeakTable WHERE val1 = ?";
    const int nParamCount = 1; 
    
    #if LEAK_NUMERIC
    char* szCreateTable = "CREATE TABLE LeakTable (val1 long)";
    #else
    char* szCreateTable = "CREATE TABLE LeakTable (val1 varchar(10))";
    #endif
    
    
    
    void main(int argc, char* argv[])
    {
    	SQLHENV henv;
    	SQLHDBC hdbc;
    	SQLHSTMT hstmt;
    	SQLRETURN nstatus;
    
    	char szConnStringOut[1024];
    	SQLSMALLINT cbConnOut;
    	SQLINTEGER status[nParamCount];
    
    #if LEAK_NUMERIC
    	SQLCHAR szParam[nParamCount][10] = {"12345"};
    #else
    	BYTE szParam[nParamCount][10] = {0x31,0x33,0x34,0x39};
    #endif
        
    	//Not checking the return codes in some cases for clarity.
    	
    	nstatus = SQLAllocHandle(SQL_HANDLE_ENV,NULL,&henv);
    	nstatus = SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION,(SQLPOINTER) SQL_OV_ODBC3,0);
    	nstatus = SQLAllocHandle(SQL_HANDLE_DBC,henv,&hdbc);
    
    	nstatus = SQLDriverConnect(hdbc,
    			NULL,
    			(SQLCHAR*) szConnStringIn,
    			SQL_NTS,
    			(SQLCHAR*) szConnStringOut,
    			sizeof (szConnStringOut),
    			&cbConnOut,
    			SQL_DRIVER_COMPLETE);
    							
    	if (nstatus != SQL_SUCCESS && nstatus != SQL_SUCCESS_WITH_INFO)
    	{
    		HandleError(hdbc,SQL_HANDLE_DBC,nstatus);
    		return;
    	}
    
    	nstatus = SQLAllocHandle(SQL_HANDLE_STMT,hdbc,&hstmt);	
    
    	nstatus = SQLExecDirect(hstmt, (SQLCHAR*) szDropTable, SQL_NTS);
    	nstatus = SQLExecDirect(hstmt, (SQLCHAR*) szCreateTable, SQL_NTS);
    
    	if (!SQL_SUCCEEDED(nstatus))
    	{
    		HandleError(hstmt,SQL_HANDLE_STMT,nstatus);
    	}
    
    	int i;
    	//only one parameter in this case
    	for (i=0; i < nParamCount; i++)
    	{
    		status[i] = SQL_NTS;
    
    
    
    #if LEAK_NUMERIC
    		nstatus = SQLBindParameter(hstmt,
    			i+1,
    			SQL_PARAM_INPUT,
    			SQL_C_CHAR,	
    			SQL_NUMERIC, 
    			10, 
    			0,
    			szParam[i],
    			10,
    			&status[i]);
    #else
    
    		nstatus = SQLBindParameter(hstmt,
    			i+1,
    			SQL_PARAM_INPUT,
    			SQL_C_BINARY,	
    			SQL_WCHAR,
    			10, 
    			0,
    			szParam[i],
    			10,
    			&status[i]);
    #endif
    	
    	
    	}
    
    	nstatus = SQLPrepare(hstmt,(SQLCHAR*) szSelectStatement, SQL_NTS);
    	if (nstatus != SQL_SUCCESS)
    	{
    		HandleError(hstmt,SQL_HANDLE_STMT,nstatus);
    	}
    
    	for (i=0; i < 100000; i++)
    	{
    		if (i % 100 == 0)
    		{
    			printf("Selected %d times\n", i);
    			//printf("Inserted %d records\n", i);
    			Sleep(100);
    		}
    		nstatus = SQLExecute(hstmt);
    		if (nstatus != SQL_SUCCESS)
    		{
    			HandleError(hstmt,SQL_HANDLE_STMT,nstatus);
    		}
    
    		SQLFreeStmt(hstmt, SQL_CLOSE);
    	}
    
    	nstatus = SQLExecDirect(hstmt, (SQLCHAR*) "DELETE FROM LeakTable", SQL_NTS);
    	if (nstatus != SQL_SUCCESS)
    	{
    		HandleError(hstmt,SQL_HANDLE_STMT,nstatus);
    	}
    
    	SQLFreeStmt(hstmt, SQL_CLOSE);
    	SQLDisconnect(hdbc);
    
    }
    
    						
    ??????: ????? ??????? ???? LEAK_NUMERIC ??? ??? ???? SQL_NUMERIC ?? SQL_C_BINARY.
  2. ????? ????? ????? ????? ?????? Microsoft Access ??? ?? ???? ?? ??? ?????? ?? ????? ???????.
  3. ??? ????? ????????? ???????? ?? ?? ???????? "?????? ??????" ??????? ?????? ????? ?????? ?????? ?? ?????.

    ???? ?? ???????? ????? ?????? ?????? ????? steadily ????? ????? ????????? ????????.

???????

???? ???????: 273772 - ????? ??? ??????: 22/?????/1426 - ??????: 2.2
????? ???
  • Microsoft Open Database Connectivity Driver for Access 4.0
  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.5 Service Pack 1
????? ??????: 
kbmt kbhotfixserver kbqfe kbbug kbfix kbjet kbmdac250sp2fix kbwin2000presp2fix KB273772 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????273772

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

 

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