chriscorran
Programmer
Hi,
I am learning ADO and can fill a list box with information from a database.
The problem is that as I add information to the list box I want the index of that line of information to be set to a specific value. ie. A value (id) from the database. The reason for this is so I can double click the list get the id for that line of information and display full details for that item based on teh id (index).
ie.
Fill list with
Chris blaaa
Bob blueee
jim josey
Tom Penny
Double click "jim". jims index (id) could be 67 so I'd search for all jims details based on his id (index).
I assume the index has to be an int and have tried
atoi((char*)_bstr_t(id));
_bstr_t(id) being the value pulled out of the database.
Why won't it work?????? Help please!!!!
A quick snippet of code would be great !!!!!!
Cheers in advance
I am learning ADO and can fill a list box with information from a database.
The problem is that as I add information to the list box I want the index of that line of information to be set to a specific value. ie. A value (id) from the database. The reason for this is so I can double click the list get the id for that line of information and display full details for that item based on teh id (index).
ie.
Fill list with
Chris blaaa
Bob blueee
jim josey
Tom Penny
Double click "jim". jims index (id) could be 67 so I'd search for all jims details based on his id (index).
I assume the index has to be an int and have tried
atoi((char*)_bstr_t(id));
_bstr_t(id) being the value pulled out of the database.
Why won't it work?????? Help please!!!!
A quick snippet of code would be great !!!!!!
Cheers in advance