none
SELECT query on nchar or nvarchar field size of >128 fails!

    Question

  • I created a table, Computers, with a column, Name. The Name column is set to Length of 128 and Data Type "nchar".

    Running a SELECT query fails with #3105, "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."

    Changing the Length to 127 or less, it works.

    Help, please?

    Code:

    ADODB::_ConnectionPtr connection; 
    ADODB::_RecordsetPtr recordset;
    
    CoInitialize(NULL);
    hr = connection.CreateInstance(__uuidof(ADODB::Connection));	
    if (FAILED(hr))
    	{
    	CoUninitialize(); 
    	return;
    	}
    
    recordset.CreateInstance(__uuidof(ADODB::Recordset));
    connection->CursorLocation = ADODB::adUseClient;
    connection->Open("Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=\"c:\\test.sdf\”;",L"",L"",0);		
    recordset->Open(L"SELECT Name FROM Computers",connection.GetInterfacePtr(), ADODB::adOpenStatic, ADODB::adLockReadOnly, ADODB::adCmdText); 


    • Edited by JeffR2 Monday, March 12, 2012 11:24 AM
    Monday, March 12, 2012 11:23 AM

All replies