J
Javier
Hi
I'm trying to retrive data from an SQL Server and use this data in
another query. Methods that retireve data with ADO give me a _btstr_t
data type and I want to convert it to a more standard std::string.
I've tried to do this
valField1 = pRstAuthors->Fields->GetItem("codigo")->Value;
printf("As _bstr_t: %s\n", (LPCSTR) valField1);
string z((const char *)valField1);
printf("As string: %s", z);
The first printf works ok and prints "As _bstr_t: 0001". The second one
hangs up the application...
I want to make this prints to be sure that convertion works well..
Any idea ?
Thanks in advance
J
PD: I'm using VC++ 6.0
I'm trying to retrive data from an SQL Server and use this data in
another query. Methods that retireve data with ADO give me a _btstr_t
data type and I want to convert it to a more standard std::string.
I've tried to do this
valField1 = pRstAuthors->Fields->GetItem("codigo")->Value;
printf("As _bstr_t: %s\n", (LPCSTR) valField1);
string z((const char *)valField1);
printf("As string: %s", z);
The first printf works ok and prints "As _bstr_t: 0001". The second one
hangs up the application...
I want to make this prints to be sure that convertion works well..
Any idea ?
Thanks in advance
J
PD: I'm using VC++ 6.0