danieleteti / delphiredisclient

Redis client for Delphi
Apache License 2.0
310 stars 134 forks source link

Getting access violation error when i try to SET ClientDataSet #8

Closed yuvankarthik closed 2 years ago

yuvankarthik commented 7 years ago

Hi , I'm trying to SET a ClientDataSet in Redis, but i'm getting AccessViolationError when i call &SET function. For storing ClientDataSet in Redis , i'm converting ClientDataSet into Bytes and then i'm calling &SET function. Below is the code which i have used , _....... ....... FRedis: IRedisClient; CDS : TClientDataSet; CDSArray : Array of TClientDataSet; ....... ....... procedure TForm1.BtnSetCDS(Sender: TObject); var Byte_Val : Array of TBytes; CDSArray : Array of TClientDataSet; begin SetLength(CDSArray,1); SetLength(Byte_Val,1); CDSArray[0] := CDS; SetLength(Byte_Val[0],Sizeof(CDS)); Move(CDSArray[0], Byte_Val[0], Sizeof(CDS)); FRedis.&SET(cds.Name,Byte_Val[0]); //Getting access violation error at this point end; ............. ............._

I don't know where i made mistake , please help me on this. Thank you.

danieleteti commented 4 years ago

Wow! I've just missed this issue. How did you solve?