I could successfully connect to the database. I also get the values and store them in a CDBVariant type. I can't put the values into List Control Box.... insertItem always return -1. It ask for LPCTSTR type.
Anyone can help me please, hanging around here know for hours?
Perhaps you would get better results on a C++ forum...
If you know that the values must be strings, and you are retrieving each one explicitly, why not just create three variables (strings), and use those. Seems like it would be a lot easier and less trouble prone.
If you are concerned about NULLs (which you should be), change your SQL statement to use the ISNULL function on each of the fields you are dealing with:
SELECT ISNULL(index,0) AS INDEX, ISNULL(product,'') AS PRODUCT, ISNULL(price,0) AS PRICE FROM TestTabelle