Where the std::string that is passed in is "SELECT CompanyId FROM Suppliers WHERE CompanyName=:name" but the string stored in the stmt variable is corrupted as above.

If I use "SELECT CompanyId FROM Suppliers WHERE CompanyName=?" instead, I get two SQL errors: "The data types nvarchar and text are incompatible in the equal to operator"; and "Statement(s) could not be prepared".

Thanks Alex. The column in my database is an nvarchar, so I'm not sure why the query returns the nvarchar/text incompatibility. Is POCO passing the std::string Parameter as a Text value? If so, is there a way to tell it what type to pass it as?

steveh wrote:If so, is there a way to tell it what type to pass it as?

No provision was made for user to arbitrarily map data types to columns; framework will do its best to map data correctly. The problem you are encountering is SQLServer-specific and we have to be generic for all ODBC drivers. Data mapping is done in ODBCMetaColumn and if you have a proposal how to improve it, let us know.