Warning C4341 when creating an OdbcParameter (C++)  
Author Message
Kamen





PostPosted: .NET Framework Data Access and Storage, Warning C4341 when creating an OdbcParameter (C++) Top

I have tried using OdbcType enumeration when adding parameters to OdbcParameterCollection of OdbcCommand objects. But under pretty much any circumstances I get warning C4341. For example, the code below will produce the warnings listed at the bottom:

OdbcCommand ^Cmd = gcnew OdbcCommand("SELECT * FROM Table0 WHERE MyIndex = ", myConnection);

OdbcParameterCollection ^ParmColl = Cmd->Parameters;

OdbcParameter ^ParmObj = gcnew OdbcParameter("MyIndex", OdbcType::Int);

ParmColl->Add(ParmObj);

Any idea as to why this is happening will be appreciated. Thanks.

Kamen

========================================================

------ Build started: Project: TestDB, Configuration: Debug Win32 ------

Compiling...

TestDB.cpp

.\TestDB.cpp(122) : warning C4341: 'WCHAR' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_C ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'SLONG' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_C ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'SSHORT' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_C ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'BIT' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_C ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'UTINYINT' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_C ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'SBIGINT' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_C ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'UBIGINT' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_C ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'BINARY' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_C ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'GUID' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_C ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'ARD_TYPE' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_C ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'LONGVARCHAR' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'WCHAR' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'WVARCHAR' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'WLONGVARCHAR' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'BIT' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'TINYINT' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'BIGINT' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'BINARY' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'VARBINARY' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'LONGVARBINARY' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'GUID' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'SS_VARIANT' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'SS_UDT' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'SS_XML' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'SS_UTCDATETIME' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

.\TestDB.cpp(122) : warning C4341: 'SS_TIME_EX' : signed value is out of range for enum constant

This diagnostic occurred while importing type 'System::Data::Odbc::ODBC32::SQL_TYPE ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

This diagnostic occurred while importing type 'System::Data::Odbc::OdbcParameter ' from assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Linking...

Embedding manifest...

Build log was saved at "file://c:\VS8\Projects\TestDB\TestDB\Debug\BuildLog.htm"

TestDB - 0 error(s), 26 warning(s)

========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========




.NET Development12  
 
 
Kamen





PostPosted: .NET Framework Data Access and Storage, Warning C4341 when creating an OdbcParameter (C++) Top

I have an update to this. To generate the above warning, all i takes is try to create a new OdbcParameter object, under any context. Here is the single line of code you need to reproduce the problem (paste in any code and compile):

System::Data::Odbc::OdbcParameter ^Parm = gcnew System::Data::Odbc::OdbcParameter();

I hope this is not somehow limited to my installation of VC++ 2005 Express, so I'd appreciate a confirmation from someone who is able to reproduce this before I report the problem to Microsoft (right now the "send feedback" site seems to be down, anyway...). Thanks.

Kamen



 
 
Vasco Veiga





PostPosted: .NET Framework Data Access and Storage, Warning C4341 when creating an OdbcParameter (C++) Top

This is a known issue. Will get fixed on later versions.
You can safely ignore the warnings.

Thanks for posting the issue.

--VV [MS]

 
 
James Atkin





PostPosted: .NET Framework Data Access and Storage, Warning C4341 when creating an OdbcParameter (C++) Top

What is the latest regarding this

I have an application in VC++ Pro (.NET 2.0) and I am getting the same warning

Any ideas

Thanks,

James