Page 1 of 1

procedure CreateAndFillParamAccs already called error

Posted: Thu 14 Oct 2010 12:26
by Fischer
dbexpsda.dll version 4.55.23
Delphi 2007 for Win32 Version 11.0.2804.9245
Windows Vista Build 6002 SP2
Microsoft SQL-Server 2005

We have a problem with a CreateAndFillParamAccs error message which allways appears in the following scenario:

Step 1:
Insert a new record into a ClientDataSet which will create a error if it is applied.

Code: Select all

  // Insert a new record without providing a value for the NOT NULL column
  cdsTest.Append;
  cdsTestTestID.Value := -1;
  cdsTestDataRequired.Clear;
  cdsTestDataOptional.Value := 'some data';
  cdsTest.Post;

  // This will show the expected NOT NULL error
  cdsTest.ApplyUpdates(0);
Calling ApplyUpdates leads to the expected error message.

Step 2:
Correct the error by entering the missing value and call ApplyUpdates again.

Code: Select all

  // provide the missing value
  if cdsTest.Locate('TestId', -1, []) then
  begin
    cdsTest.Edit;
    cdsTestDataRequired.Value := 'more data';
    cdsTest.Post;
  end;

  // This shows the CreateAndFillParamAccs Error
  cdsTest.ApplyUpdates(0);
This allways leads to the following error message:

procedure CreateAndFillParamAccs already called (OLEDBAccess.pas, line 5666)

Step 3:
Dont change anything and just call ApplyUpdates again.

Code: Select all

cdsTest.ApplyUpdates(0)
The new record has now been inserted into the database.

The table used for the above steps has been created like this:

Code: Select all

-- Create a simple test table
IF Object_ID('TestTbl') IS NOT NULL
	DROP TABLE TestTbl

CREATE TABLE TestTbl
(
	TestID int IDENTITY(1,1) NOT NULL,
	DataRequired VARCHAR(15) NOT NULL,
	DataOptional VARCHAR(15) NULL		
	CONSTRAINT PK_TestTbl PRIMARY KEY
	(
		TestID ASC
	)
)
If needed we can provide a little test program to show how to reproduce this error.

Posted: Mon 18 Oct 2010 06:41
by AndreyZ
Hello,

I cannot reproduce the problem. Please send your test program to andreyz*devart*com.

Posted: Tue 19 Oct 2010 07:15
by AndreyZ
Thank you for information. We have reproduced the problem. The investigation of the problem is in progress. As soon as we solve the problem we will let you know.

Posted: Mon 25 Oct 2010 13:30
by Dimon
We have fixed this problem. This fix will be included in the next DbxSda build.

Posted: Wed 10 Nov 2010 08:21
by sqeeshy
Hello, we have almost the same problem (with same message and behavior) but in VCL components for SQL Server. We use SDAC v.4.8.0.60. There is a bugfix in revision history for SDAC v5.x ("Fixed bug with processing parameters when query is executed with error"), but will this bug be fixed for 4.8.x? Thanks.

Posted: Wed 10 Nov 2010 09:13
by AndreyZ
You should upgrade SDAC to version 5.00.0.2 to get this fix. If you have a license for SDAC 4.8, you don't have to buy a new version. Please use your link, username, and password for Registered Users' Area to download SDAC version 5.00.0.2.