I use OTL in dev c++ to interact with the sql db. I form the command by appending strings so that the user can choose to view 1,more or all columns from a table, then pass it to sql to get executed. I get a stream of data from sql with the requested data and i register it into a vector of structs :
wich i then pass to other functions.
The thing is that it takes each data and puts it first into id then name and continues this way until eof, wich is perfect if you select all fields, but tryes to do the same if you only select 1 column and that creates problems, as you can imagine.
One way i can think of solving this is asking the user what he wants to do and breaking it into several cases in a switch statement, each with it's own way to record the data, but that can be big and ugly for a bigger table. So my question is if anyone has a better way of doing this.