FIX: ???? ??????? ?? ???? SQLOLEDB MDAC ??? SERVERDATAONINSERT ???? ?????? ???? ???? ?? 255

?????? ????????? ?????? ?????????
???? ???????: 302995 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
????? ???? | ?? ????

?? ??? ??????

???????

???? ???? ??????? ???? ?? ???? Microsoft OLE DB ?? SQL Server (SQLOLEDB) ?? SERVERDATAONINSERT ??? ??? ?????? ???? ?? 255.

????

??? ??? ???????? ??? ?????? ??? ???? ???? ???? ?? Microsoft MDAC 2.5. ?????? ??? ??????? ??????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
293312INFO: ????? ?????? ??? ???? MDAC 2.5 ???? ???????
?? ????? ?? ??? ??????? ?? ???? ?????? ??? ???? ???? ???? ?? SQL Server 2000 ?? ???? ???? ???? ?? MDAC 2.6 ?? ??????? ?????? ?????? ????? ?????. ?????? ??? ??????? ??????? ???? ??? ??? ??????? ????? ?????? ?? "????? ??????? ?? Microsoft:
290211INF: ????? ?????? ??? ???? ???? ???? ??????? SQL Server 2000
?????? ??? ??????? ??????? ???? ??? ??? ??????? ????? ?????? ?? "????? ??????? ?? Microsoft:
300635INFO: ????? ?????? ??? ???? MDAC 2.6 ???? ???????

?????????

MDAC 2.5

??? ?? ???? ?????? ?????????? ?? ??? ??????? ???? ??????? ??????? ?? ????:
   Date         Version    Size           File name     Platform
   -------------------------------------------------------------
   04-Jun-2001  7.1.9.99   545,040 bytes  Sqloledb.dll  x86
				
MDAC 2.6

??? ?? ???? ?????? ?????????? ?? ??? ??????? ???? ??????? ??????? ?? ????:
   Date          Version        Size           File name     Platform
   ------------------------------------------------------------------
   11-Jun-2001   2000.80.301.0  491,584 bytes  Sqloledb.dll  x86
   11-Jun-2001   2000.80.301.0   61,440 bytes  Sqloledb.dll  x86
				

?????

???? Microsoft ?? ??? ????? ?? ?????? Microsoft ??????? ?? ????? ??? ???????. ?? ????? ??? ??????? ???? ??? ?? Microsoft MDAC 2.5 ?????? ????? ?????? Service Pack 3.?? ????? ??? ??????? ???? ??? ?? ???? ?????? Service Pack 2 ?????? ?? MDAC 2.6 "?" SQL Server 2000 ?????? ????? ?????? Service Pack 2.

??????? ????

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

  1. ?? Microsoft SQL Server 2000 ????? ??????? ???????:
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[STATEMIN1]') 
    and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[STATEMIN1]<BR/>
    GO
    
    CREATE TABLE [dbo].[STATEMIN1] (
    	[messagekey] [int] IDENTITY (1, 1) NOT NULL ,
    	[message] [varchar] (2000) NOT NULL 
    ) ON [PRIMARY]
    GO
    
    ALTER TABLE [dbo].[STATEMIN1] WITH NOCHECK ADD 
    	CONSTRAINT [PK_STATEMIN1] PRIMARY KEY  CLUSTERED 
    	(
    		[messagekey]
    	)  ON [PRIMARY] 
    GO
    					
  2. ?? ???? ???????? ???????? ??????? ?? ????? ???? ???? Microsoft Visual C++ ??? ?? ????? ????????? ????????.

    ??????: ??? ???? ????? ??? ???? ?????? ???? ???????? ????? ??????.
    #include <afx.h>
    #include <assert.h>
    #include <iostream>
    #include <atldbcli.h>
    #include <objbase.h>
    
    const ULONG nInitProps = 4;
    const ULONG nPropSet = 1;
    const ULONG nParams = 3; //Number of parameters in the command
    const ULONG nProps = 5;
    
    struct StateIn
    	{
    	UINT uiMessageKey;
    	TCHAR pszMessage[257];
    };
    
    int main(void)
    {
       	CCommand<CManualAccessor,CRowset,CNoMultipleResults> rs;
    
    	CDataSource m_connect;
    	CSession m_session;
    	
    	DBPROP    InitProperties[nProps];
    	DBPROPSET   rgInitPropSet;
    
    	USES_CONVERSION;
    	HRESULT   hr;
    
    	hr = CoInitialize(NULL);
    
    	for (ULONG i = 0; i < nProps; i++ )
    	{
    		VariantInit(&InitProperties[i].vValue);
    		InitProperties[i].dwOptions = DBPROPOPTIONS_REQUIRED;
    		InitProperties[i].colid = DB_NULLID;
    	}
    
    	InitProperties[0].dwPropertyID = DBPROP_INIT_PROMPT;
    	InitProperties[0].vValue.vt = VT_I2;
    	InitProperties[0].vValue.iVal = DBPROMPT_NOPROMPT;
    
    	InitProperties[1].dwPropertyID = DBPROP_INIT_DATASOURCE;
    	InitProperties[1].vValue.vt = VT_BSTR;
    	InitProperties[1].vValue.bstrVal = 
             SysAllocString(OLESTR("servername"));                            // Server Name
    
    	InitProperties[2].dwPropertyID = DBPROP_INIT_CATALOG;
    	InitProperties[2].vValue.vt = VT_BSTR;
    	InitProperties[2].vValue.bstrVal = SysAllocString(L"database");    // Database Name
    	InitProperties[2].dwOptions = DBPROPOPTIONS_REQUIRED;
    	InitProperties[2].colid = DB_NULLID;
    
    	InitProperties[3].dwPropertyID = DBPROP_AUTH_USERID;
    	InitProperties[3].vValue.vt = VT_BSTR;
    	InitProperties[3].vValue.bstrVal = SysAllocString(OLESTR("sa"));    // User Id.
    
    	InitProperties[4].dwPropertyID = DBPROP_AUTH_PASSWORD;
    	InitProperties[4].vValue.vt = VT_BSTR;
    	InitProperties[4].vValue.bstrVal = SysAllocString(OLESTR(""));      // Password
    
    	
    	rgInitPropSet.guidPropertySet = DBPROPSET_DBINIT;
    	rgInitPropSet.cProperties = nProps;
    	rgInitPropSet.rgProperties = InitProperties;
    
    	char szProgID[100] = {0};
    	strcpy(szProgID,"SQLOLEDB");
    	CLSID clsid;
    	WCHAR   wszProgId[100] = {0};
    	MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szProgID, -1,   wszProgId, 100);
    	hr = CLSIDFromProgID(wszProgId, &clsid);
    	hr = m_connect.Open(clsid,&rgInitPropSet);
    	hr = m_session.Open(m_connect);
    
    	SysFreeString(InitProperties[1].vValue.bstrVal);
    	SysFreeString(InitProperties[2].vValue.bstrVal);
    	SysFreeString(InitProperties[3].vValue.bstrVal);
    	SysFreeString(InitProperties[4].vValue.bstrVal);
    
    	DWORD dwStatus;
    	dwStatus = DBSTATUS_S_IGNORE;
    
    	CDBPropSet propset(DBPROPSET_ROWSET);
    	propset.AddProperty(DBPROP_IRowsetChange, true);
    	propset.AddProperty(DBPROP_IRowsetUpdate, false);
    	propset.AddProperty(DBPROP_UPDATABILITY,
    		DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE);
    	propset.AddProperty(DBPROP_SERVERDATAONINSERT,true);
    
    	StateIn rowValue_StateIn;
    
    	rs.CreateAccessor(2, &rowValue_StateIn, sizeof(rowValue_StateIn));
    
    	rs.AddBindEntry(1, DBTYPE_I4,sizeof(rowValue_StateIn.uiMessageKey), 
              &rowValue_StateIn.uiMessageKey,NULL,&dwStatus);
    	rs.AddBindEntry(2, DBTYPE_STR, sizeof(rowValue_StateIn.pszMessage),
              &rowValue_StateIn.pszMessage,NULL);
    
    	TCHAR * m_strQuery = _T("select * from statemin1");
    	hr = rs.Create(m_session,m_strQuery);
    	hr = rs.Open(&propset);
    	
    	dwStatus = DBSTATUS_S_IGNORE;
    	TCHAR szInsStr[50];
    	strcpy(szInsStr,"test1");
    
    	strcpy(rowValue_StateIn.pszMessage, szInsStr);
    
    	hr = rs.Insert(0,1);
    
    	for(int j = 0;j < 20000;j++)
    	{	
    		strcpy(rowValue_StateIn.pszMessage, szInsStr);
    		hr = rs.Insert(0,1);
    
    	}
    
       	return S_OK;
    }
    					
  3. ??? ????? "?????? ??????" ??????? ?????? ????? ?????? ?????? ?? ????? ????? ????? ????????? ????????.
?????? ??? ??????? ??????? ???? ??? ??? ??????? ????? ?????? ?? "????? ??????? ?? Microsoft:
301953SQLOLEDB: Unenlisting ?? ????????? ?????? ????? ????? SQL Server 7.0 ????? ? ????? ????

???????

???? ???????: 302995 - ????? ??? ??????: 28/???? ??????/1435 - ??????: 4.1
????? ???
  • Microsoft Data Access Components 2.1
  • Microsoft Data Access Components 2.1 Service Pack 2
  • Microsoft Data Access Components 2.1 Service Pack 1
  • Microsoft Data Access Components 2.1 Service Pack 2
  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.5 Service Pack 1
  • Microsoft Data Access Components 2.5 Service Pack 2
  • Microsoft Data Access Components 2.6
????? ??????: 
kbnosurvey kbarchive kbmt kbhotfixserver kbqfe kbmdac250sp3fix kbbug kbfix kbmdac260sp2fix kbsqlserv2000presp2fix KB302995 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????302995

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

 

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