Page 1 of 1

MS-SQL Server and PB

Posted: Tue Jun 07, 2011 7:37 am
by Tranquil
Hello community.

I noticed a strange issue by reading datas from a MS-SQL Server connected by an ODBC driver.

Initially I stored all my Datas in MS-Access flatfiles. They become very huge over the years so we decided to port them to a MS SQL Server.
So far es well, no problems.

But then I encountered, that some "GetDatabaseXYZ" commands returned just 0 or an empty string. The column of the data-table was successfully found so at first I did not see a reason why the returned value was wrong.
After many hours of trying I found the solution.

It seems to depend on the order which I grab the datas.
The Database has, for example, the following two columns: "A as Text, B as Test"
If I do a SELECT * Query on that and try to pull column B as first, it could happen that the returned string is zero. If I pull "A" first, everything is okay.

Is that a normal behaviour of MS Sql or is there a bug anywhere? Maybe in the ODBC SQL Driver!?

Thanks for reading and any hint on this!

Re: MS-SQL Server and PB

Posted: Tue Jun 07, 2011 9:04 am
by Kiffi
Tranquil wrote:If I do a SELECT * Query on that and try to pull column B as first, it could happen that the returned string is zero. If I pull "A" first, everything is okay.
confirmed.
Tranquil wrote:Is that a normal behaviour of MS Sql or is there a bug anywhere? Maybe in the ODBC SQL Driver!?
don't know. If i connect the SQL Server - DSN via ADODB (with AutoIt)
i am able to read out the fieldvalues regardless of the fieldorder.

Schöne Grüße nach Duisburg ... Kiffi

Re: MS-SQL Server and PB

Posted: Tue Jun 07, 2011 9:31 am
by Tranquil
Thanks Kiffi for confirming my problem.

I now tried the same query in Access using the same SQL ODBC connection and it works. Regardles of the order.

Maybe then its a bug within PureBasic?

And Greetings back to "the Dom Stadt" :-)