I have a rather odd situation:
I have an application writting in C++ (MSVC++ 6), which uses ODBC to handle some database querys. I am using standard SQLDriverConnect, SQLExecDirect, SQLFetch, and SQLGetData. I do the fetch's while fetch returns a valid result, and then do GetData (searching by column name with (getting the column number via SQLDescribeCol given a column name.) I get all the fields I need and then do another fetch until there are none left. Pretty basic. (the results being generated by a simple SQL query through SQLExecDirect, "SELECT * FROM [tablename] where [something]=[somethinglese]."
This method returns very proper results from MySQL, PostgreSQL, and Microsoft Text ODBC driver, however when used with MS SQL Server 2000 (SP2), I keep getting a situation where it's pulling one or two fields and filling every GetData request with the same data from those like there was no new data to obtain.
The obtaining of column numbers seems to be accurate (I have it logging that.) It gets different numbers for each field of inquiry, and since it works for other database, I have no reason to believe that part is false.
That said, is there anything "special" I should be doing for MSSQL that wouldn't need to be done for the other databases, or is there a fundamental flaw in what I'm doing that all the other formats could ignore? I'm really at a loss for what could be wrong.
I spared the code pastes if someone has an answer with out it (it could be rather lengthy since a lot of things get passed through objects, etc, so you'd probably need the full class to understand some things, and it's not a small application .
Thanks in advance for any attempts to help on this...it's driving me quite crazy!
~JohnMalv
I have an application writting in C++ (MSVC++ 6), which uses ODBC to handle some database querys. I am using standard SQLDriverConnect, SQLExecDirect, SQLFetch, and SQLGetData. I do the fetch's while fetch returns a valid result, and then do GetData (searching by column name with (getting the column number via SQLDescribeCol given a column name.) I get all the fields I need and then do another fetch until there are none left. Pretty basic. (the results being generated by a simple SQL query through SQLExecDirect, "SELECT * FROM [tablename] where [something]=[somethinglese]."
This method returns very proper results from MySQL, PostgreSQL, and Microsoft Text ODBC driver, however when used with MS SQL Server 2000 (SP2), I keep getting a situation where it's pulling one or two fields and filling every GetData request with the same data from those like there was no new data to obtain.
The obtaining of column numbers seems to be accurate (I have it logging that.) It gets different numbers for each field of inquiry, and since it works for other database, I have no reason to believe that part is false.
That said, is there anything "special" I should be doing for MSSQL that wouldn't need to be done for the other databases, or is there a fundamental flaw in what I'm doing that all the other formats could ignore? I'm really at a loss for what could be wrong.
I spared the code pastes if someone has an answer with out it (it could be rather lengthy since a lot of things get passed through objects, etc, so you'd probably need the full class to understand some things, and it's not a small application .
Thanks in advance for any attempts to help on this...it's driving me quite crazy!
~JohnMalv