I am a newbie to c++, so maybe this one's too easy, tho apparently not
for me:
1. I am using MS Visual Studio.
2. I have a std::string variable.
3. Its value might contain embedded null chars.
4. I want to insert/update it in an ADO parameter to be presented to
an SQL statement, one whose CommandText is something such as:
Select * from mytable where key = ?
So my q is, how do I convert it from its current string format into
something that ADO (i.,e. Command>-Parameter->Item[n]->Value will
accept?
I can't assign it directly, that doesn't even compile. I can't use
c_str() or any other function that employs a char * argument because
of the embedded nulls in the data, and when I try to use an
intermediate _bstr_t wrapper, the data seems to turn up garbled (can I
assume that's a single- vs double- byte problem?)
Anyway, thx if anyone can help; hope this is the correct group for
such a q.