Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Update MS SQL table from DBGRID not working


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Aug 16, 2017 6:33 PM Last Post By: Jan Erik Roed Threads: [ Previous | Next ]
Jan-Erik Roed

Posts: 10
Registered: 12/10/12
Update MS SQL table from DBGRID not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 15, 2017 12:07 PM
I am on Delphi 10.2
Using Microsoft SQL Server 2014 (SP1-CU13) (KB4019099) - 12.0.4522.0 (X64)
Jun 28 2017 17:36:31
Copyright (c) Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 15063: )
I have a select statement : Select * from manufacturers order by name
The DBGRID is linked to a Datasource and datasource linked to a FDQuery - FDQuery linked to a FDConnection.
When I try to update a column in the DBGRID the application and post, it gives me this error message:
[firedac][phys][odbc][microsoft][SQL server Native Client 11.0][SQL server] Transaction (Process ID 51) was deadlocked on lock | generic waitable object resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

When I remove the "order by name" from the select it happily updates the table.
I have not changed any defaults anywhere.
Hope somebody can help out.
Thanks in advance.
Best regards
Jan Erik Roed
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: Update MS SQL table from DBGRID not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 15, 2017 12:13 PM   in response to: Jan-Erik Roed in response to: Jan-Erik Roed
Jan-Erik Roed wrote:

I am on Delphi 10.2
Using Microsoft SQL Server 2014 (SP1-CU13) (KB4019099) - 12.0.4522.0
(X64) Jun 28 2017 17:36:31
Copyright (c) Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3
<X64> (Build 15063: ) I have a select statement : Select * from
manufacturers order by name The DBGRID is linked to a Datasource and
datasource linked to a FDQuery - FDQuery linked to a FDConnection.
When I try to update a column in the DBGRID the application and post,
it gives me this error message: [firedac][phys][odbc][microsoft][SQL
server Native Client 11.0][SQL server] Transaction (Process ID 51)
was deadlocked on lock | generic waitable object resources with
another process and has been chosen as the deadlock victim. Rerun the
transaction.

When I remove the "order by name" from the select it happily updates
the table. I have not changed any defaults anywhere.
Hope somebody can help out.
Thanks in advance.
Best regards
Jan Erik Roed

This question has nothing to do with the Delphi IDE and should be
posted in Embarcadero.public.delphi.database.firedac
Jan-Erik Roed

Posts: 10
Registered: 12/10/12
Re: Update MS SQL table from DBGRID not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 15, 2017 11:22 PM   in response to: Lajos Juhasz in response to: Lajos Juhasz
Lajos Juhasz wrote:
Jan-Erik Roed wrote:

I am on Delphi 10.2
Using Microsoft SQL Server 2014 (SP1-CU13) (KB4019099) - 12.0.4522.0
(X64) Jun 28 2017 17:36:31
Copyright (c) Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3
<X64> (Build 15063: ) I have a select statement : Select * from
manufacturers order by name The DBGRID is linked to a Datasource and
datasource linked to a FDQuery - FDQuery linked to a FDConnection.
When I try to update a column in the DBGRID the application and post,
it gives me this error message: [firedac][phys][odbc][microsoft][SQL
server Native Client 11.0][SQL server] Transaction (Process ID 51)
was deadlocked on lock | generic waitable object resources with
another process and has been chosen as the deadlock victim. Rerun the
transaction.

When I remove the "order by name" from the select it happily updates
the table. I have not changed any defaults anywhere.
Hope somebody can help out.
Thanks in advance.
Best regards
Jan Erik Roed

This question has nothing to do with the Delphi IDE and should be
posted in Embarcadero.public.delphi.database.firedac

Please - I do not understand this answer/comment???
I have gone to Embarcadero.public.delphi.database.firedac as it says and my question comes up!!
So then what?
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: Update MS SQL table from DBGRID not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 15, 2017 11:43 PM   in response to: Jan-Erik Roed in response to: Jan-Erik Roed
Jan-Erik Roed wrote:

Please - I do not understand this answer/comment???
I have gone to Embarcadero.public.delphi.database.firedac as it says
and my question comes up!! So then what?

This post is in embarcadero.public.delphi.ide. To check out I've tested
with globe button in the XanaNews it takes to the
https://forums.embarcadero.com/thread.jspa?messageID=896117&tstart=0#896
117 - according to the web interface the question is in: Embarcadero
Discussion Forums » Delphi » IDE.

I doubt that Dmitry Arefiev will find this question here.

Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: Update MS SQL table from DBGRID not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 16, 2017 4:19 AM   in response to: Jan-Erik Roed in response to: Jan-Erik Roed
Jan-Erik Roed wrote:

Please - I do not understand this answer/comment???
I have gone to Embarcadero.public.delphi.database.firedac as it says
and my question comes up!! So then what?

It shows up there too indeed, but it also appears in .ide, so something
is wrong.

--
Rudy Velthuis http://www.rvelthuis.de

"The multitude of books is a great evil. There is no limit to
this fever for writing."
-- Martin Luther
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: Update MS SQL table from DBGRID not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 16, 2017 5:11 AM   in response to: Rudy Velthuis (... in response to: Rudy Velthuis (...
Rudy Velthuis (TeamB, MVP) wrote:

Jan-Erik Roed wrote:

Please - I do not understand this answer/comment???
I have gone to Embarcadero.public.delphi.database.firedac as it
says and my question comes up!! So then what?

It shows up there too indeed, but it also appears in .ide, so
something is wrong.

Not here in XN the post shows only here in the IDE group.
Jan Erik Roed

Posts: 2
Registered: 8/18/16
Re: Update MS SQL table from DBGRID not working  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 16, 2017 6:33 PM   in response to: Lajos Juhasz in response to: Lajos Juhasz
Lajos Juhasz wrote:
Rudy Velthuis (TeamB, MVP) wrote:

Jan-Erik Roed wrote:

Please - I do not understand this answer/comment???
I have gone to Embarcadero.public.delphi.database.firedac as it
says and my question comes up!! So then what?

It shows up there too indeed, but it also appears in .ide, so
something is wrong.

Not here in XN the post shows only here in the IDE group.
Hopefully I have now managed to post it in the Firedac Forum.
Thank you guys for making me aware :-)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02