Re: oledb-group by



thanks everybody

Actually we solved the problem using conn1.execute('set engine behavior 70')
than it behave like we use ODBC dll. the problem was when we use OLEDB we
have to mention the field name that come after GROUP BY as in "select
f1,... from ...group by f1"
When we use VFPODBC.dll we don't use like that.Actually above useage is
regular group by usage.

But it was not easy to change all the code.
then I set engine behavior to 70 just after opening connection. now it is
working.
thanks.
ismail


"Olaf Doschke" <T2xhZi5Eb3NjaGtlQFNldG1pY3MuZGU@xxxxxxxxxx> wrote in message
news:ePXEsBq6FHA.2600@xxxxxxxxxxxxxxxxxxxxxxx
> In general the GROUP BY clause works like it should in
> OLEDB. Since the latest ODBC driver only has the SQL
> engine of VFP6, you could use it wrongly before, like
> Anders pointed out.
>
> eg.
>
> select band, title, ;
> count(*) as NumberOfTitles;
> from songs;
> group by band
>
> is wrong but worked in ODBC/older VFP versions. ODBC
> may have given you the first title it found as title. In general you
> would either have to group by band AND title, but then would
> mostly have a count of 1 or use MIN(title) to have the
> alphabetical first title or leave out the title completely.
>
> In general you must group by all simple fields, that you select
> and don't use some aggregating function on them, like
> MIN, MAX, AVG, SUM, COUNT. If you think about
> it, it's logical and necessary.
>
> Another scenario, that doesn't work at all with group by
> or distinct is a memo field in the result set.
>
> Bye, Olaf.
>
>


.



Relevant Pages

  • Re: oledb-group by
    ... SQL92 rules in queries with GROUP BY. ... > then I set engine behavior to 70 just after opening connection. ... Since the latest ODBC driver only has the SQL ... >> select band, title,; ...
    (microsoft.public.fox.vfp.dbc)
  • Re: Migrating to OLEDB
    ... Certainly OLE DB is extremely flexible and I certainly understand that the ... in making a decision to use OLE DB over ODBC for a "typical" application. ... I am presently grappling with problems with OLEDB in our own application (an ... request a Forward-Only, Static, Keyset Driven, or Dynamic cursor type ...
    (microsoft.public.data.odbc)
  • Re: Migrating to OLEDB
    ... Certainly OLE DB is extremely flexible and I certainly understand that the ... in making a decision to use OLE DB over ODBC for a "typical" application. ... I am presently grappling with problems with OLEDB in our own application (an ... request a Forward-Only, Static, Keyset Driven, or Dynamic cursor type ...
    (microsoft.public.data.oledb)
  • Re: VFP Updates?
    ... Try talking ODBC or OleDb and they say HU. ... make up my apps so that what ever they want to run has to be from a command ... kind of connection and assign it the right to do exactly what you want. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Migrating to OLEDB
    ... See 30 well-tested and real OLEDB examples ... In our tests the ODBC ... to have LOTS of features and to support ... >> YCY> Specifically, SQL Server and Oracle providers are faster than ...
    (microsoft.public.data.oledb)

Loading