String Conversion

I am currently trying to convert a string that resides in a _bstr_t variable vFieldDate into a char array. I have found that I can type cast this via the (char *) with a variable I named holder which is a pointer to a char. The issue I am having a hard time solving is how to convert this to a char that can be stored within the char Date[ARR]. When I attempt the following code I get the compilation error "Cannot Convert From Char * to Char. How do I extract the value that resides in the holder location and save it into the array?

Date[cyc] = holder;

The below portions of code are a part of an ADO program that is accessing data from a database.

char Date[ARR] = {};
_bstr_t vFieldDate;
vFieldDate = rec->Fields->GetItem("Date")->Value;
char *holder = (char*)vFieldDate;


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion