SQL Server Compact Edition 3.5 gives “Multiple-ste

2019-02-28 18:44发布

问题:

I'm using a SQL Server CE database via Microsoft's OLEDB 3.5 SQL CE Driver. Here's my connection string:

Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=C:\Users\me\Desktop\test1.sdf

This query works fine:

SELECT Thing FROM OtherThing WHERE name = 'TextThing'

This query fails:

SELECT Foo FROM Stuff

And this is the error I get:

Multiple-step operation generated errors. Check each status value.

The only structural difference in the table themselves is that one has a text primary key and the other has a bigint identity field as a primary key.

What I've tried:

  • http://support.microsoft.com/kb/269495 (neither of the resolution conditions are true for me)
  • Switched the cursorLocation property from adUseClient to adUseServer (this caused none of my queries to work - same error). That said, I think maybe I shouldn't give up on this one (thoughts?).

回答1:

The problem has to do with the fact that the tables that caused that exception to be thrown were ones with fields of type nvarchar and sizes of 255. I changed those to ntext or reduced the size to 100 and no exception was thrown.