Board index » delphi » TSQlQuery and TSQLClientDateSet Problem

TSQlQuery and TSQLClientDateSet Problem

Hi,

Im having 2 problems:
1) During a transaction when I try to clear the contents of the SQL in the TSQlQuery I get an Access Violation. My program is something like this:

Connection.StartTrans...
SqlQuery.SQL.Clear;
SqlQuery.SQL.Add('delete from customer')

try
  SqlQuery.ExecSQl;
except
  something...
  end;

SqlQuery.SQL.Clear;   ----> Access Violation
SqlQuery.SQL.Add('delete from company')
try
  SqlQuery.ExecSQl;
except
  something...
  end;
Connection.Commit...
The action Violation occurs when I try to clear it the second time during a transaction. Can anyone help????

2) When I try to open a TSqlclientDataset I can only open 36 records otherwise it gives me an  error 'Operation Aborted'
My select is something like this:
  'select * from customer fetch first 36 rows only'
if the number of rows is 36 or less, it works, for anything over 36 it gives me 'Operation Aborted'.

Any ideas???

Thanks in advance

 

Re:TSQlQuery and TSQLClientDateSet Problem


Maybe your query is open when you trying to do SQL.Clear.

Quote
"Fabio Pasquali" <Nilo...@terra.com.br> wrote in message

news:3bfa4327$1_2@dnews...
Quote

> Hi,

> Im having 2 problems:
> 1) During a transaction when I try to clear the contents of the SQL in the

TSQlQuery I get an Access Violation. My program is something like this:
Quote

> Connection.StartTrans...
> SqlQuery.SQL.Clear;
> SqlQuery.SQL.Add('delete from customer')

> try
>   SqlQuery.ExecSQl;
> except
>   something...
>   end;

> SqlQuery.SQL.Clear;   ----> Access Violation
> SqlQuery.SQL.Add('delete from company')
> try
>   SqlQuery.ExecSQl;
> except
>   something...
>   end;
> Connection.Commit...
> The action Violation occurs when I try to clear it the second time during

a transaction. Can anyone help????
Quote

> 2) When I try to open a TSqlclientDataset I can only open 36 records

otherwise it gives me an  error 'Operation Aborted'
Quote
> My select is something like this:
>   'select * from customer fetch first 36 rows only'
> if the number of rows is 36 or less, it works, for anything over 36 it

gives me 'Operation Aborted'.

- Show quoted text -

Quote

> Any ideas???

> Thanks in advance

Re:TSQlQuery and TSQLClientDateSet Problem


No, I only use ExecSQL, besides, I dont have any select statements in this program.

Quote
"Ihar Lazerka" <I.Laze...@belcaf.com> wrote:
>Maybe your query is open when you trying to do SQL.Clear.

>"Fabio Pasquali" <Nilo...@terra.com.br> wrote in message
>news:3bfa4327$1_2@dnews...

>> Hi,

>> Im having 2 problems:
>> 1) During a transaction when I try to clear the contents of the SQL in the
>TSQlQuery I get an Access Violation. My program is something like this:

>> Connection.StartTrans...
>> SqlQuery.SQL.Clear;
>> SqlQuery.SQL.Add('delete from customer')

>> try
>>   SqlQuery.ExecSQl;
>> except
>>   something...
>>   end;

>> SqlQuery.SQL.Clear;   ----> Access Violation
>> SqlQuery.SQL.Add('delete from company')
>> try
>>   SqlQuery.ExecSQl;
>> except
>>   something...
>>   end;
>> Connection.Commit...
>> The action Violation occurs when I try to clear it the second time during
>a transaction. Can anyone help????

>> 2) When I try to open a TSqlclientDataset I can only open 36 records
>otherwise it gives me an  error 'Operation Aborted'
>> My select is something like this:
>>   'select * from customer fetch first 36 rows only'
>> if the number of rows is 36 or less, it works, for anything over 36 it
>gives me 'Operation Aborted'.

>> Any ideas???

>> Thanks in advance

Re:TSQlQuery and TSQLClientDateSet Problem


Hi Fabio,

With regards to #1, I am unable to reproduce the behavior when I create a simple transaction.  Can you please create a small testcase to demonstrate
the problem since we may be doing some things differently?  Also, please include any pertinent information such as which server, version, etc.  I
tried this against DB2 v7.

With regards to #2, as per JohnK's response to your other post, the problem has been logged into Raid and will be investigated.

Thanks,

Marilyn

Quote
Fabio Pasquali wrote:
> Hi,

> Im having 2 problems:
> 1) During a transaction when I try to clear the contents of the SQL in the TSQlQuery I get an Access Violation. My program is something like this:

> Connection.StartTrans...
> SqlQuery.SQL.Clear;
> SqlQuery.SQL.Add('delete from customer')

> try
>   SqlQuery.ExecSQl;
> except
>   something...
>   end;

> SqlQuery.SQL.Clear;   ----> Access Violation
> SqlQuery.SQL.Add('delete from company')
> try
>   SqlQuery.ExecSQl;
> except
>   something...
>   end;
> Connection.Commit...
> The action Violation occurs when I try to clear it the second time during a transaction. Can anyone help????

> 2) When I try to open a TSqlclientDataset I can only open 36 records otherwise it gives me an  error 'Operation Aborted'
> My select is something like this:
>   'select * from customer fetch first 36 rows only'
> if the number of rows is 36 or less, it works, for anything over 36 it gives me 'Operation Aborted'.

> Any ideas???

> Thanks in advance

Other Threads