diff --git a/Providers/FreeSql.Provider.MsAccess/MsAccessAdo/MsAccessAdo.cs b/Providers/FreeSql.Provider.MsAccess/MsAccessAdo/MsAccessAdo.cs index c10affcbe..908e972d0 100644 --- a/Providers/FreeSql.Provider.MsAccess/MsAccessAdo/MsAccessAdo.cs +++ b/Providers/FreeSql.Provider.MsAccess/MsAccessAdo/MsAccessAdo.cs @@ -62,13 +62,13 @@ public override object AddslashesProcessParam(object param, Type mapType, Column { if (Utils.TypeHandlers.TryGetValue(typeof(DateTime), out var typeHandler)) return typeHandler.Serialize(param); if (param.Equals(DateTime.MinValue) == true) param = new DateTime(1970, 1, 1); - return string.Concat("'", ((DateTime)param).ToString("yyyy-MM-dd HH:mm:ss"), "'"); + return string.Concat("cdate('", ((DateTime)param).ToString("yyyy-MM-dd HH:mm:ss"), "')"); } else if (param is DateTime?) { if (Utils.TypeHandlers.TryGetValue(typeof(DateTime?), out var typeHandler)) return typeHandler.Serialize(param); if (param.Equals(DateTime.MinValue) == true) param = new DateTime(1970, 1, 1); - return string.Concat("'", ((DateTime)param).ToString("yyyy-MM-dd HH:mm:ss"), "'"); + return string.Concat("cdate('", ((DateTime)param).ToString("yyyy-MM-dd HH:mm:ss"), "')"); } else if (param is TimeSpan || param is TimeSpan?)