Currently the order is:
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, 0);
SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc);
SQLDriverConnect(hdbc, NULL, (SQLCHAR*)szdatabase, (short)(strlen(szdatabase)+1, NULL, 0...
I had thought of that, but I'm pretty sure it's there. I think it even installs with Win2k and WinXP, it's not optional.
The MDAC was upgraded to 2.71 as well on all machines (working and non)
Interesting, though, in this instance, I'm quite certain the field is longer than 256 characters. In fact there are instances where it can be 10k :).
Good advice though (though Unicode gives me nightmares.)
If I have a text field which I need to put some text and ascii data via a query, however that data contains one or more single quotes, is there a way to get that data in there without changing those quotes to a uniform "alternate" character? I tried \' already, and it still fails.
According to the person who reported the troubles, he tried (successfully) to create a DSN to the same database on the same system, while the DSN-less connection string is experiencing problems. Username is defintely a different error than this one. In fact, the only way I have personally...
That's an interesting point you bring up about SERVER= not being the host machine, as well as the agent. That could become a problem later on.
However, the problem right now I believe occurs BEFORE it attempts to connect to the server (if it tries to connect to one that isn't valid, it stalls...
The connection string format in use is:
DRIVER={SQL Server};SERVER=localhost;DATABASE=vrbtest;UID=sa;PWD=admin;
This has worked on most systems I've tried (and modified for a remote SQL server). However, it has also failed on several.
Sorry, I'm actually using SQLDriverConnect, I was going from memory when I sayd SQLConnect :).
returncode = SQLDriverConnect(hdbc, NULL, (SQLCHAR*)szdatabase, (short)(strlen(szdatabase)+1), NULL, 0, NULL, SQL_DRIVER_NOPROMPT);
Thanks for catching that though!
I'm having this (yes, another) problem with MSSQL Server (though I'm uncertain if it's MSSQL specific yet), and I don't know if it's something on the code level or something on a system level. I suspect system level, but it's worth a shot to look into programmatic options as well. I've tried...
Thanks for the response. Actually I did figure out the solution to that part of the mystery (forgot to post it here).
It was actually SQLGetData that was failing, and the reason for the difference was that MSSQL apparently doesn't support SQL_ANY_ORDER (I BELIEVE from memory that's the correct...
I have this odd problem I began describing on the MS SQL Server forum, but was reccommended that there may be some new insight here:
I have an application that uses a basic SQLExecuteDirect, SQLFetch, SQLGetData (and an SQLDescribeCol based function to grab column numbers based on col names...
Yes, perhaps I'll post on the C++ forum.
I just tried osql, and the query (same one being executed (successfully) in the application is being executed successfully there too. It looks like good data. The SQL_NO_DATA on SQLFetch is definitely the problem...
Just as an update, I tried setting a primary key for column 1, but it didn't help.
Still getting SQL_NO_DATA for the SQLFetch(), but ONLY for MSSQL, not MySQL, MS Text, or PostgreSQL...
Hmm, I should probably move this to a new thread now, as I have a little more information. I'll post it here for now to see if you have more info, if not, I'll put it on a new thread.
It seems the point of faulre is SQLFetch. It's returning SQL_NO_DATA. The question is why? Since it's...
Sadly, that didn't seem to help :( (Thanks for the try though, I had forgotten to patch it...but I'm still pulling the same problem data (repeated data and blank data, using the same app that works fine using the above mentioned alternate DBS systems.)
Any other ideas?
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.