String Conversion - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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;


Comments

Sign In or Register to comment.