Board index » delphi » can't set RequestLive to a SQL Server SQL

can't set RequestLive to a SQL Server SQL

Quote
willard wrote:

> I use a TQuery1, It's SQL is : Select name from student.
> I set the RequestLive of Tquery1 to true in design time and open
> Query1 in run time,and login in with ID sa, but the system give me a
> error message:
> not found object sa.STUDENT
> If I set the RequestLive to False, It work, but I can't edit data.

> How can I set the Tquery1 to RequestLive?
> I have try copy the same Database to Paradox, It work!

        Try putting "dbo" in the table name.

        Select * from dbo.Student

        brant
        ...

 

Re:can't set RequestLive to a SQL Server SQL


I use a TQuery1, It's SQL is : Select name from student.
I set the RequestLive of Tquery1 to true in design time and open Query1
in
run time,and login in with ID sa, but the system give me a error
message:
not found object sa.STUDENT
If I set the RequestLive to False, It work, but I can't edit data.

How can I set the Tquery1 to RequestLive?
I have try copy the same Database to Paradox, It work!

Re:can't set RequestLive to a SQL Server SQL


This is a multi-part message in MIME format.

------=_NextPart_000_01BC23CD.C27274C0
Content-Type: text/plain; charset=BIG5
Content-Transfer-Encoding: 7bit

There is something seriously screwed with this post
MS News would only let me reply in HTML or Chinese !!!!

You need to identify (and select) the primary key on the table to get a
live reult set
The primary key must be set up on sql server

willard <will...@mail.tccgeb.edu.tw> wrote in article
<3314375F....@mail.tccgeb.edu.tw>...

Quote
> I use a TQuery1, It's SQL is : Select name from student.
> I set the RequestLive of Tquery1 to true in design time and open Query1
> in
> run time,and login in with ID sa, but the system give me a error
> message:
> not found object sa.STUDENT
> If I set the RequestLive to False, It work, but I can't edit data.

> How can I set the Tquery1 to RequestLive?
> I have try copy the same Database to Paradox, It work!

------=_NextPart_000_01BC23CD.C27274C0
Content-Type: text/html; charset=BIG5
Content-Transfer-Encoding: quoted-printable

<html><head></head><BODY bgcolor=3D"#FFFFFF"><p><font size=3D2 =
color=3D"#000080"><br><font face=3D"MS LineDraw">There is something =
seriously screwed with this post<br>MS News would only let me reply in =
HTML or Chinese !!!!<br><br>You need to identify (and select) the =
primary key on the table to get a live reult set<br>The primary key must =
be set up on sql server<br><br><font face=3D""><br><font =
face=3D"Arial">willard &lt;<font =
color=3D"#0000FF"><u>will...@mail.tccgeb.edu.tw</u><font =
color=3D"#000080">&gt; wrote in article &lt;<font =
color=3D"#0000FF"><u>3314375F....@mail.tccgeb.edu.tw</u><font =
color=3D"#000080">&gt;...<br>&gt; I use a TQuery1, It's SQL is : Select =
name from student.<br>&gt; I set the RequestLive of Tquery1 to true in =
design time and open Query1<br>&gt; in<br>&gt; run time,and login in =
with ID sa, but the system give me a error<br>&gt; message:<br>&gt; not =
found object sa.STUDENT<br>&gt; If I set the RequestLive to False, It =
work, but I can't edit data.<br>&gt; <br>&gt; How can I set the Tquery1 =
to RequestLive?<br>&gt; I have try copy the same Database to Paradox, It =
work!<br>&gt; <br>&gt; </p>
</font></font></font></font></font></font></font></font></body></html>
------=_NextPart_000_01BC23CD.C27274C0--

Re:can't set RequestLive to a SQL Server SQL


Quote
Kelly Hoinacki wrote:

> Try logging in as a user that aliases dbo instead of the sa user.

Thank for your immediately answer. But when I log in as a user of dbo
I do'nt know the password of dbo. Where to get or set the password of
dbo in SQL Server?

Re:can't set RequestLive to a SQL Server SQL


Quote
willard <will...@mail.tccgeb.edu.tw> wrote:
>I use a TQuery1, It's SQL is : Select name from student.
>I set the RequestLive of Tquery1 to true in design time and open Query1
>in
>run time,and login in with ID sa, but the system give me a error
>message:
>not found object sa.STUDENT
>If I set the RequestLive to False, It work, but I can't edit data.
>How can I set the Tquery1 to RequestLive?
>I have try copy the same Database to Paradox, It work!

If you are using an ODBC connection to SQL Server then the BDE
generates SQL statements with all tablenames prefixed by the login
name fo live queries. To override this behaviour do following

Select name from dbo.student

You will not have this problem if using SQL Links to connect to your
SQL Server

Hope this works

Paul Templeton

Re:can't set RequestLive to a SQL Server SQL


Another way of solving this is to make sure that in Logins sa's alias is
dbo for the database.

Paul Templeton <pdtem...@dircon.co.uk> wrote in article
<5f7tpn$ko...@newsserver.dircon.co.uk>...

Quote
> willard <will...@mail.tccgeb.edu.tw> wrote:

> >I use a TQuery1, It's SQL is : Select name from student.
> >I set the RequestLive of Tquery1 to true in design time and open Query1
> >in
> >run time,and login in with ID sa, but the system give me a error
> >message:
> >not found object sa.STUDENT
> >If I set the RequestLive to False, It work, but I can't edit data.

> >How can I set the Tquery1 to RequestLive?
> >I have try copy the same Database to Paradox, It work!

> If you are using an ODBC connection to SQL Server then the BDE
> generates SQL statements with all tablenames prefixed by the login
> name fo live queries. To override this behaviour do following

> Select name from dbo.student

> You will not have this problem if using SQL Links to connect to your
> SQL Server

> Hope this works

> Paul Templeton

Other Threads