Assertion failure with sdac 7.01 in direct mode

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
feamster
Posts: 24
Joined: Thu 11 Nov 2004 12:59

Assertion failure with sdac 7.01 in direct mode

Post by feamster » Wed 03 Dec 2014 21:50

exception class : EAssertionFailed
exception message : Assertion failure (D:\Projects\Delphi\Dac\Common\Source\MemData.pas, line 2880).

main thread ($7e0):
0071cdde +016a PEANUTS.exe MemData TData.GetFieldData
0079da06 +01ba PEANUTS.exe CRAccess TCRRecordSet.GetFieldData
0071d03c +00c4 PEANUTS.exe MemData TData.GetField
00735287 +007f PEANUTS.exe MemDS TMemDataSet.GetFieldData
0073507b +0013 PEANUTS.exe MemDS TMemDataSet.GetFieldData
006f6894 +0038 PEANUTS.exe Data.DB 13030 +2 TDataSet.GetFieldData
00735099 +0011 PEANUTS.exe MemDS TMemDataSet.GetFieldData
006e4301 +00a1 PEANUTS.exe Data.DB 5025 +9 TField.GetData
006e6ca3 +007f PEANUTS.exe Data.DB 6147 +5 TWideStringField.GetValue
006e6b36 +001e PEANUTS.exe Data.DB 6124 +1 TWideStringField.GetAsVariant
00a6a1bc +00b4 PEANUTS.exe newutils2 1456 +15 Updt


The actual routine which allows me to move values between datasets based on the field names.
The source is a tmsquery and the destination is a dbisam table. This only happens in direct mode. If I change to prauto (which will be oledb) it works fine.

Here is the actual routine:

Procedure Updt(Sr, ds: TDataSet);
Var
wsd: AnsiString;
Values: VARIANT;
Names: Tstrings;
iFields, iField, ifield2: integer;
itable, otable: TDataSet;
rr: integer;
Begin
Names := TStringlist.Create;
itable := TDataSet(Sr);
otable := TDataSet(ds);
otable.disablecontrols;
itable.disablecontrols;
otable.edit;
With itable Do
Begin
iFields := FieldCount - 1;
Values := VarArrayCreate([0, iFields], varVariant);
itable.GetFieldNames(Names);

For iField := 0 To iFields Do
Begin
Values[iField] := Fields[iField].Value; //<- This is where the exception occurs
End;

ifield2 := 0;

For iField := 0 To iFields Do
Begin
Try
If otable.FindField(Names[iField]) <> Nil Then
If otable.FieldByName(Names[iField]).canmodify = true Then
otable.FieldByName(Names[iField]).Value := Values[iField];
Except
End;
End;
End;
otable.post;
otable.enablecontrols;
itable.enablecontrols;
Names.Free;
End;

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Assertion failure with sdac 7.01 in direct mode

Post by azyk » Thu 04 Dec 2014 09:18

Thank you for the information. We have reproduced the problem and investigation is in progress. We will inform you when we have any results.

alphanull
Posts: 2
Joined: Thu 04 Dec 2014 00:57

Re: Assertion failure with sdac 7.01 in direct mode

Post by alphanull » Sat 06 Dec 2014 11:02

I have a similar problem. Any string from the database that happens to be empty causes this assertion error when trying to read it. This occurs in the SQL editor as well
I hope that a quick solution can be found. I am happy to send sample code and any other details to help track down the problem. I purchased the product with source code only two days ago. Looking at the source code I can see that some kind of trap needs to go in to stop converting nothing to pointers

Thanks

N. Thoresen
Software Integration and Design
Brisbane Australia

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Assertion failure with sdac 7.01 in direct mode

Post by azyk » Wed 10 Dec 2014 11:40

Fixing of this bug is in progress. This fix will be included into the next SDAC build. The next SDAC build will be released within 1 month.

Post Reply