View Issue Details

IDProjectCategoryView StatusLast Update
0003610JEDI VCL00 JVCL Componentspublic2006-04-14 06:01
ReportercfzwitAssigned Toobones 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.10 
Target VersionFixed in Version3.30 
Summary0003610: Fixed error in "GetValues" method for JvMemoryData
DescriptionHi !!!

I change this method (GetValues), becuase produce an variant conversion error.
This is the complete source ( ONLY IN "GetValues" METHOD !!! )

function TJvMemoryData.GetValues(FldNames: string = ''): Variant;
var
  List : TList;
  I: Integer;
begin
  Result := Null;
  if FldNames = '' then
    FldNames := FKeyFieldNames;
  If FldNames = '' Then Exit;

  If Pos(';',FldNames) > 0 Then
  Begin
    List := TList.Create;
    GetFieldList(List,FldNames);
    Result := VarArrayCreate([0, List.Count - 1], varVariant);
    for I := 0 to List.Count - 1 do
      Result[I] := TField(List[I]).Value;
    FreeAndNil(List);
  End
  Else
  Begin
    Result := VarArrayCreate([0,0],VarVariant);
    Result[0] := FieldByName(FldNames).Value;
  End;
end;

Please, change this routine into the CVS (JvMemoryData.Pas) in the JEDI site.

Thank You !!!
TagsNo tags attached.

Activities

obones

2006-04-13 02:52

administrator   ~0009083

What's the point of this change?
What was the problem it is supposed to fix?
Please provide a sample application showing the problem, AFTR you have tried with the latest JVCL.

cfzwit

2006-04-13 04:50

reporter   ~0009087

>> What's the point of this change?
1)Into the method "GetValues", I eliminate the auxiliar routine "FldsNamesToStrList", and use the method "GetFieldList" from the ancestor class TDataset.
2) If the returned value IS ONLY FOR ONE FIELD, I return a Variant Array ( [0,0] ) with the field <-- In previous version, I return a Variant without array.

>> What was the problem it is supposed to fix?
This method, is used into the method "ApplyChanges", I Get the key values of the records changed and try LOCATE the record in the original Dataset before apply the changes. With BDE and IBX the actual version not have problems, but with other ( ADO, DBISam, DBX, etc ) the locate method of Dataset crashed, IF THE RETURNED VALUE IS ONLY ONE FIELD, because is NOT content into a ARRAY of variant.

>> Please provide a sample application showing the problem, AFTR you have tried with the latest JVCL
This bug haved revelead for an colega, (not work with BDE/IBX) and I not have the source code. Sorry.

Thank You for your feedbak !!!

obones

2006-04-14 06:01

administrator   ~0009108

Thanks, this is now in CVS.

Issue History

Date Modified Username Field Change
2006-03-26 09:29 cfzwit New Issue
2006-04-13 02:52 obones Note Added: 0009083
2006-04-13 02:52 obones Status new => feedback
2006-04-13 04:50 cfzwit Note Added: 0009087
2006-04-14 06:01 obones Status feedback => resolved
2006-04-14 06:01 obones Resolution open => fixed
2006-04-14 06:01 obones Assigned To => obones
2006-04-14 06:01 obones Note Added: 0009108