tmsquery.active=false after tmsquery.Open

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
haidomingo

tmsquery.active=false after tmsquery.Open

Post by haidomingo » Fri 13 Jan 2006 23:36

Sorry for my bad english.

...
...
QSnAss.SQL.Clear;
QSnAss.SQL.Add('Select * From ListaSn');
QSnAss.MasterSource:=DSLineeDocumentoIn;
QSnAss.SQL.Add('WHERE (ListaSn.[Documento Acquisto]='
+QuotedStr (DocumentiNumeroDocumento.value)+')');
QSnAss.SQL.Add(' AND (ListaSn.IdArticoloInterno=:IdArticoloInterno)');
QSnAss.Execute;

the state of QSnAss.Active after execution this code is false, Why??
(SDAC 3.50)
Thanks

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 16 Jan 2006 13:34

Please specify for which reason you set MasterSource property.

haidomingo

Problem resolved

Post by haidomingo » Mon 16 Jan 2006 15:14

Ikar wrote:Please specify for which reason you set MasterSource property.
The reason: QSnAss is detail table

I have renamed QSnAss ---> SnDocumento and problem resolved:

SnDocumento.SQL.Clear;
SnDocumento.SQL.Add('Select * From ListaSn');
SnDocumento.SQL.Add('WHERE (ListaSn.IdDocIn=:IdDoc)');
SnDocumento.SQL.Add(' AND (ListaSn.IdArticoloInterno=:IdArticoloInterno)');
SnDocumento.paramByName('IdDoc').Value:=DocumentiIdDocumento.AsString;
SnDocumento.MasterSource:=DSLineeDocumentoIn;
SnDocumento.Execute;

Possible bug (TMSQuery.Name='QSnAss'?
Thanks

tinof
Posts: 39
Joined: Fri 16 Dec 2005 07:41

Post by tinof » Tue 17 Jan 2006 07:25

Hi,

sorry, it seems a little bit too easy but i want to post nevertheless :

Should you call the open() - method instead of execute() to get a resultset ?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 17 Jan 2006 11:50

We don't think that the problem is in component name or in use of Execute method. Maybe there was an error in your first example.If you try to execute SQL code with error in syntax, QSnAss can't be Active neither using Execute method, nor Open method.

Post Reply