Thanks, for the help.
But now there's another problem. I can't get the result of the
sql search in the vector.
It's a char pointer like this char* pszReceivedData=NULL;
It gives me error message that is about mile long.
error C2109: subscript requires array or pointer type
error C2109: subscript requires array or pointer type
error C2440: '=' : cannot convert from 'char *' to
'class std::vector<class std::vector<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> >,class
std::allocator<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > > >,class
std::allocator<class std::vector<class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> >,
class std::allocator<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > > > > >
(__thiscall CexecuteSearch::*)(void)'
What / how do I have to convert the result to make it work ?
----
mkarja
jt*******@presby.edu (Jon Bell) wrote in message news:<br**********@jtbell.presby.edu>...
In article <75*************************@posting.google.com> ,
mkarja <mm**********@hotmail.com> wrote:
<--- myprog.h --->
#define MAXROWS 200
#define MAXCOLUMNS 100
std::string pszResultValues[MAXROWS][MAXCOLUMNS];
<--- myprog.h --->
<--- myprog.cpp --->
long row=0,column=0;
pszResultValues[row][column]=_bstr_t(pszReceivedData);
<--- myprog.cpp --->
I loop through the results and add them to pszResultValues.
It works fine MAXROWS isn't bigger than 200 and MAXCOLUMNS
isn't bigger than 100. If I put MAXCOLUMNS value past 100
it fails. Is that some sort of array restriction or what ?
There's no fundamental restriction (in the C++ language), but your
compiler or operating system may have a limit on how memory you can
allocate for an "automatic" variable (often called "on the stack").
Is there a way to somehow define dynamic values to
MAXROWS and MAXCOLUMNS or is there some other solution.
Try using a vector of vectors instead of a 2d array. Vectors allocate
their data memory dynamically, i.e. not "on the stack".
std::vector<std::vector<std::string> > pszResultValues (MAXROWS,
std::vector<std::string>(MAXCOLUMNS));