Search found 32 matches

by swright
Thu 17 Feb 2022 10:41
Forum: SQL Server Data Access Components
Topic: Cannot modify a read-only dataset
Replies: 4
Views: 17351

Re: Cannot modify a read-only dataset

I have taken a look and managed to create the problem with this test.

tblTest.FilterSQL := AnsiQuotedStr('Agent Code','"')+'='+AnsiQuotedStr('0TESTA12','''');
tblTest.Open;
MSConnection1.StartTransaction;
try
for i := 0 to tblTest.Fields.Count-1 do
tblTest.Fields.ReadOnly := True;
tblTest.Delete;
finally
MSConnection1.Rollback;
end;

The above code deletes the row in 9.3.2 (then rolls back). Fails with "Cannot Modify a read-only dataset" in 10.0.2

The reason for the fields being set read only is that the editor for the row is shown "read only" to the end user so they can see what they are deleting before clicking delete to remove the row.

I made another test using TTable and that deletes the row like 9.3.2.

Regards
by swright
Wed 19 Jan 2022 15:31
Forum: SQL Server Data Access Components
Topic: Cannot modify a read-only dataset
Replies: 4
Views: 17351

Cannot modify a read-only dataset

Delphi 7 SDAC issue after update

Updated from 9.3.2 to 10.0.2 and keep getting "Cannot modify a read-only dataset" when calling MSTable.Delete.

Reverted to 10.0.1 and still get the same issue.

Reverted to 9.3.2 and all working ok again.
by swright
Mon 28 Sep 2020 14:55
Forum: SQL Server Data Access Components
Topic: IDENTITY INSERT
Replies: 1
Views: 11937

IDENTITY INSERT

Hello is it possible to use SET IDENTITY INSERT [TABLE] ON with TMSTable

I can execute SET IDENTITY INSERT ON within a transaction, but TMSTable gives exception 'Field 'idField' cannot be modified.

I tried options.InsertAllSetFields and also get the same exception.
by swright
Wed 09 Sep 2020 09:59
Forum: SQL Server Data Access Components
Topic: TMSTable NOLOCK
Replies: 1
Views: 10899

TMSTable NOLOCK

Is it possible for me to change the TMSTable generated SQL to include WITH(NOLOCK).
by swright
Wed 14 Feb 2018 12:01
Forum: SQL Server Data Access Components
Topic: Delphi 7 SDAC 8.0.4 Error
Replies: 3
Views: 1916

Re: Delphi 7 SDAC 8.0.4 Error

Thanks for the reply.

Those files were not present, However I found the problem, a component using sdac needed recompiling.

I am not using the NonBlocking option.
by swright
Mon 12 Feb 2018 11:39
Forum: SQL Server Data Access Components
Topic: Delphi 7 SDAC 8.0.4 Error
Replies: 3
Views: 1916

Delphi 7 SDAC 8.0.4 Error

Delphi 7

I upgraded from 8.0.2 to 8.0.3 and had complaints that the application was going non responsive never to return.

I managed to recreate this in the debugger a few times and it appeared to be calling WaitForMultipleObjects, like it is waiting for a thread to terminate that never does. (I cannot be sure at this point that this is a problem with SDAC).

So I Installed 8.0.4

On startup i get the error

"The procedure entry point @Crthread@initialization$qqrv could not be located in the dynamic link library sdac70.bpl"

For now I have reverted to 8.0.2 to see how it goes.

Regards

Steve
by swright
Tue 06 Sep 2016 09:07
Forum: SQL Server Data Access Components
Topic: DLL project issue
Replies: 3
Views: 2274

Re: DLL project issue

I was unable to at first so I spent some time tracking it down.

I get the problem in a DLL when a TDatamodule is created in a unit initialization where the datamodule is creating a TMSSQLMonitor component and it locks when it gets to TMSSQLMonitor.Loaded.

if you change Active to false then it will create the datamodule.

I have made an example:-

https://www.dropbox.com/s/a3h1l5ukkk8vj ... t.zip?dl=0
by swright
Fri 02 Sep 2016 15:38
Forum: SQL Server Data Access Components
Topic: DLL project issue
Replies: 3
Views: 2274

DLL project issue

Hello,

Today I updated SDAC for Delphi7 from 510d7Pro to 7.3.13

I have a problem with a DLL project when building a DLL with the newer version, the DLL I built this morning before the update is working without any issues.

After the update the DLL host test application makes the call to LoadLibrary and it just hangs and eventually It gets a "this application is not responding"


Event Viewer shows:-
Faulting application name: CarcSysTest.exe, version: 0.0.0.0, time stamp: 0x2a425e19
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x03c868c1
Faulting process id: 0x25d0
Faulting application start time: 0x01d2052ae83f6967
Faulting application path: C:\CARCASE\MSSQL_SVN\Application\CarcSysTest.exe
Faulting module path: unknown


Any Ideas, could this be a problem with SDAC unit initialization in a DLL?

if I copy the DLL i built just before installing the newer SDAC into the folder the host application loads the DLL and all is working.

Other executable projects appear to be working ok.
by swright
Mon 21 Feb 2011 15:11
Forum: SQL Server Data Access Components
Topic: Error When Connecting
Replies: 1
Views: 1114

Error When Connecting

When connecting I keep getting the following (not every time though)

Named pipes provider could not open a connection to sql server [53]


Any Ideas?
by swright
Wed 17 Nov 2010 10:50
Forum: SQL Server Data Access Components
Topic: Problem updating a query
Replies: 4
Views: 1544

Is there another method to specify the primary key fields for the re-read and update.
by swright
Wed 17 Nov 2010 10:46
Forum: SQL Server Data Access Components
Topic: Problem updating a query
Replies: 4
Views: 1544

Thanks,


I had already worked that one out with dbMonitor.
by swright
Mon 15 Nov 2010 16:03
Forum: SQL Server Data Access Components
Topic: Problem updating a query
Replies: 4
Views: 1544

Problem updating a query

HELP!!!!!!!

I have a problem with a query and update updating more than one record where only one record should be changed.

the code adds the sql to qryAnima, opens it

it then does

if (not qryAnimal.IsEmpty) then
begin
qryAnimal.Edit;
{ sets 3 fields eartag / idlot / idtransaction }
qryAnimal.Post;
end;

problem is the edit and post update multiple records, because the lock and update does not take 'Detained No' field into consideration.


I have used dbmonitor to show the SQL

The Initial query :-

SELECT TOP 1 "ANIMAL"."Lot No","ANIMAL"."Kill Date","ANIMAL"."Kill Time","ANIMAL"."Species","ANIMAL"."Participant Code","ANIMAL"."EarTag","ANIMAL"."idLot","ANIMAL"."idTransaction" FROM "ANIMAL" WHERE "ANIMAL"."Species"='PIGS' AND "ANIMAL"."Participant Code"='001' AND "ANIMAL"."Kill Date"='2010-11-15' AND "ANIMAL"."Lot No"='LOT1 ' AND "ANIMAL"."Detained No"=10 AND "ANIMAL"."idTransaction" IS NULL

then Savepoint LOCK_qryAnimal

SELECT * FROM ANIMAL
WITH (UPDLOCK, ROWLOCK, HOLDLOCK)
WHERE
[Lot No] = ? AND [Kill Date] = ? AND [Kill Time] = ? AND Species = ? AND [Participant Code] = ? AND EarTag = ? AND idLot IS NULL AND idTransaction IS NULL

the update

UPDATE ANIMAL
SET
EarTag = ?, idLot = ?, idTransaction = ?
WHERE
[Lot No] = ? AND [Kill Date] = ? AND [Kill Time] = ? AND Species = ? AND [Participant Code] = ? AND EarTag = ? AND idLot IS NULL AND idTransaction IS NULL
by swright
Wed 21 Jul 2010 16:07
Forum: SQL Server Data Access Components
Topic: deadlock error
Replies: 7
Views: 1965

Thanks for the reply.

I tried that and it did not work.

I also tried setting the locktype to ltnolock.

The select statement had some aggregate select statements, I added WITH (NOLOCK) to each of these and I think it may have solved it.

regards

Steve
by swright
Tue 20 Jul 2010 15:43
Forum: SQL Server Data Access Components
Topic: deadlock error
Replies: 7
Views: 1965

I assume the error is returned by the engine. problem is how do I handle it.

Only one of the apps is using a transaction to insert records into the database.

The second "victim" app is running a select query (reading).

the error is still presented, even if i place a try/except around the query.open
by swright
Fri 09 Jul 2010 16:01
Forum: SQL Server Data Access Components
Topic: deadlock error
Replies: 7
Views: 1965

In both cases it is ilReadCommitted and only one process is in a transaction inserting records. The other is a TMSQuery 'select'