unwanted SET NO_BROWSETABLE ON generated by tadodataset

5.5k views Asked by At

i have a problem in my delphi application with tadodataset the simple question after switching from delphi xe2 to xe9 and sql2014 i see in profiler that all of my queries started with SET NO_BROWSETABLE ON this cause recompile stored procedures and functions in sql server can some one tell me how can i disable this option and sample code

ADODataSet1.Close; ADODataSet1.CommandText := 'Select * from mytable'; ADODataSet1.Open;

and result in profiler : SET NO_BROWSETABLE ON Select * from mytable

1

There are 1 answers

3
MartynA On

Your question seems to imply that the SET NO_BROWSETABLE ON has only started since changing to a more recent Delphi version.

If that is what you mean, I am not sure your observation is accurate, at least I cannot reproduce any difference in behaviour between an app compiled with the current Delphi version, XE10 Seattle and Delphi 7 from 15 years go regarding NO_BROWSETABLE.

I have an instance of Sql Server 2014 running on this machine, which is Windows 10 Pro 64-bit. If I compile and run a minimal Delphi Seattle project that does a simple select * from sometable using a TAdoConnection and a TAdoQuery, Sql Server's Profiler shows the MDac layer sending a SET NO_BROWSETABLE ON, like you. However, if I compile and run exactly the same project in Delphi 7, I get exactly the same statements shown in the profiler - there is no difference whatsoever if the app is compiled in D7 or Seattle.

This is with the cursor location set to clUseClient. The SET NO_BROWSETABLE ON doesn't occur if I use clUseServer. It also doesn't occur in a minimal DBExpress application using a TSqlConnection and TSqlQuery so maybe that uses a server-side cursor as well.

See here for more info about NO_BROWSETABLE:

https://support.microsoft.com/en-us/kb/885146

I'm using the Microsoft OLE DB Provider for Sql Server. Although this is said to be deprecated by MS, I've always had far less trouble with it than with their provider for ODBC or that "native client" one.

You also might want to take a look at this SO q:

Strange ADO behavior generating unwanted NO_BROWSETABLE / set fmtonly queries in VB6

Btw you mention "xe9". Do you mean XE8 or Delphi Seattle or what?