> Walter Prins wrote:
>> RTFM,  especially on TSQLQuery.ExecSQL, as it says on the bottom of that
>> page:
>>
>> "Note: Do not use ExecSQL for commands such as SELECT queries that return
>> data. When the command returns data, use the Open method or set the 
>> Active
>> property to true."
>
> What's the reasoning behind that advice?

I'm not clear what you're asking here, are you asking what *my* reasoning 
whas behind my advice/response, or are you asking what Borland's reasoning 
was behind putting the quoted advice in the help file?

In any event, the original question was:
> i am using dbExpress with MySQL , i written this code :
>
> DB.Close;
> DB.SQL.Clear;
> DB.SQL.Add('SELECT * FROM MySBB_subject ORDER BY id DESC LIMIT 1,1');
> DB.ExecSQL;
> Memo1.Lines.Add(SM.TraceList.Text);
>
> but i don't know how i can fetcho info now ?

>From this question, it appeared to me the original poster was unclear on how 
to retrieve the results of the select statement.  Thus, I suggested he read 
the manual/help on the ExecSQL method, as this clearly explains that for 
SELECT queries you should not use ExecSQL, but rather use the Open method.

If you were actually asking what Borland's reasoning behind that advice in 
the help is, I assume it's simply because that's how things work: Open 
returns a result set, ExecSQL doesn't.  The first part of the help page 
makes that clear, but they put extra emphasis on this point with this latter 
note (which I quoted,) probably because this issue is sometimes overlooked 
by developers (as the posting of this question indeed illustrates.)

Cheers

Walter 



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to