The text in subject is that which is shown in a debug assertion error message box displayed when the m_pConn->Open(...) method below is called. When this line of code is executed, I am converting a CString variable (connectionString) to a _bstr_t. The full text of the error message is "Debug Assertion Failed! dbgdel.cpp Line: 52 _BLOCK_TYPE_IS_VALID". Can anyone shed light on this? This code was previously working. I must have changed something, but I don't know what. Please note, I am reading some entries for the ADO connection string from registry entries and populating these entries in my program as CString variables.
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source = " + accessDBPath2;
connectionString = "Provider=SQLOLEDB;Data Source=" + mvwin32SQLsrvName + ",1433;Network Library=DBMSSOCN;Initial Catalog=" + mvwin32SQLsrvDB + ";" + "Trusted_Connection=Yes;";
m_pConn->Open( _bstr_t( connectionString ), _bstr_t( "" ), _bstr_t( "" ), adConnectUnspecified );