Code: Select all
PROCEDURE TMainForm.ActivateOffender(OID : UInt64);
BEGIN
ejDM.dsOffender.DataSet.Locate('id', OID, []);
END;
I modified DecodeVariant like so, and Locate() started to work again:
Code: Select all
{**
Decodes a standard variant value into custom variant.
@param Value a standard variant value to be decoded.
@returns an decoded custom variant.
}
function DecodeVariant(const Value: Variant): TZVariant;
begin
case VarType(Value) of
varSmallint, varInteger, varByte:
DefVarManager.SetAsInteger(Result, Integer(Value));
varBoolean: DefVarManager.SetAsBoolean(Result, Value);
varString:
DefVarManager.SetAsString(Result, Value);
{$IFDEF DELPHI12_UP}
varUString:
DefVarManager.SetAsUnicodeString(Result, Value);
{$ENDIF}
varSingle, varDouble, varCurrency:
DefVarManager.SetAsFloat(Result, Value);
varUnknown: DefVarManager.SetAsInterface(Result, Value);
varOleStr:
DefVarManager.SetAsUnicodeString(Result, Value);
varDate: DefVarManager.SetAsDateTime(Result, Value);
varShortInt, varWord, varLongWord:
DefVarManager.SetAsInteger(Result, Value);
varInt64,varUInt64: // KGM - added varUInt64 case
DefVarManager.SetAsInteger(Result, Value);
else
DefVarManager.SetNull(Result);
end;
end;
so... a more elegant fix is probably necessary, but at least DecodeVariant will stop setting my ^&#@$!! value to NULL!
MySQL uses unsigned 64 bit Ints for autoincrement fields.
Best regards,
Kevin G. McCoy