Board index » delphi » MS SQL Server - getting read-only query with requestlive=true

MS SQL Server - getting read-only query with requestlive=true

Hello
I am using a tquery component with requestlive=true for both live results
and read-only queries.
In Paradox this works fine, but with ms sql server I get an exception and no
results.
Is there a way to disable the exception the sql server raises when the query
is read only?
 

Re:MS SQL Server - getting read-only query with requestlive=true


Quote
> Is there a way to disable the exception the sql server raises when the
query
> is read only?

It is probably better to know when to use Requestlive, and when not, however
you could also do the following in your Open statements:

    try
        Open
    except
        on E: EDBEngineError do begin
            //you should probably check here that you have the Requestlive
error by checking E.Message
            RequestLive:=False;
            Open;
        end;
    end;

Oliver

Re:MS SQL Server - getting read-only query with requestlive=true


I use a C/S structure, the error is received at the client, so how do I set
the server's query requestlive from the client?

Quote
"Oliver Townshend" <oli...@zip.com.au> wrote in message

news:3e44c041@newsgroups.borland.com...
Quote
> > Is there a way to disable the exception the sql server raises when the
> > query is read only?

> It is probably better to know when to use Requestlive, and when not,
however
> you could also do the following in your Open statements:

>     try
>         Open
>     except
>         on E: EDBEngineError do begin
>             //you should probably check here that you have the Requestlive
> error by checking E.Message
>             RequestLive:=False;
>             Open;
>         end;
>     end;

> Oliver

Re:MS SQL Server - getting read-only query with requestlive=true


Quote
> I use a C/S structure, the error is received at the client, so how do I
set
> the server's query requestlive from the client?

This is just a dataset property isn't it?

Oliver

Re:MS SQL Server - getting read-only query with requestlive=true


well, found a way of doing it by checking if certain words (like 'join' or
'distinct') appear in the sql.

Quote
"Oliver Townshend" <oli...@zip.com.au> wrote in message

news:3e44f4ab@newsgroups.borland.com...
Quote
> > I use a C/S structure, the error is received at the client, so how do I
> set
> > the server's query requestlive from the client?

> This is just a dataset property isn't it?

> Oliver

Other Threads