Getting Delphi 7 to play with SQL Server Compact 3.5

青春壹個敷衍的年華 提交于 2019-11-28 11:36:15
whosrdaddy

Don't use ExecSQL for queries that return recordsets.

Set either the AdoQuery.Active property to True or use AdoQuery.Open to execute a SELECT statement.

UPDATE

After changing your code we see the real error which is DB_E_OBJECTOPEN.

UPDATE2

After digging deeper it seems that this is a known bug in the OLE DB provider and nvarchar fields bigger than 127 characters.

these references seem to confirm this:

SO: SQL Server Compact Edition 3.5 gives "Multiple-step operation generated errors" error for simple query

ref1: http://www.tech-archive.net/Archive/SQL-Server/microsoft.public.sqlserver.ce/2008-07/msg00019.html

ref2: https://forums.embarcadero.com/thread.jspa?messageID=474517

ref3: http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/48815888-d4ee-42dd-b712-2168639e973c

Changing the cursor type to server side solved the 127 char issue for me :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!