From cae8c36e84edebbd07644c30adbd4748e523aabb Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Sun, 21 Jan 2024 01:58:39 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8D=20MsAccess=20=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E9=97=AE=E9=A2=98=EF=BC=9B#1724=20#1725?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FreeSql.Provider.MsAccess/MsAccessAdo/MsAccessAdo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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?)