Apache OpenOffice (AOO) Bugzilla – Issue 107601
Problem opening MSSQL tables via unixODBC with uniqueidentifier as primary key
Last modified: 2013-01-29 21:47:07 UTC
I am trying to open tables in an MSSQL database from OO.o Base via unixODBC, but when I try, I get the following error: The data content could not be loaded. [unixODBC][Driver Manager]Invalid cursor state I also get the same error if I run a query as "SELECT * FROM MyTable". However, if I run the query as "SELECT ID, Field1, Field2 FROM MyTable", including all of the fields from the table, the query runs. Also, if I run "SELECT * FROM MyTable" with "Run SQL Command Directly" selected, it also works. So, I ran the SQL Server profiler on the "SELECT * FROM MyTable" query, without "Run SQL Command Directly", and the following queries show up: -- declare @p1 int set @p1=1 exec sp_prepare @p1 output,N'@P1 varchar(80)',N'SELECT * FROM "MyTable" WHERE "MyTable"."ID" = @P1',1 select @p1 -- declare @p1 int set @p1=2 exec sp_prepare @p1 output,N'@P1 BINARY(1)',N'SELECT * FROM "MyTable" WHERE "MyTable"."ID" = @P1',1 select @p1 -- I'm not sure what OO.o Base is trying to do here, but trying to compare a uniqueidentifier field with INT doesn't seem to be working. Also, I'm not convinced that this isn't an issue with unixODBC or FreeTDS. OO.o 3.1 unixodbc 2.2.11 freetds 0.82 Thanks!
> ...trying to compare a uniqueidentifier field with INT doesn't seem to be working Nevermind that bit. That's not what the query is trying to do (uppercase @P1 vs lowercase @p1). Still I don't know what it's doing there. Thanks!