如何解决[SQL Server]从字符串转换为 smalldatetime 数据类型时发生语法错误。
MicrosoftOLEDBProviderforODBCDrivers错误'80040e07'[Microsoft][ODBCSQLServerDriver][SQLS...
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]从字符串转换为 smalldatetime 数据类型时发生语法错误。
/admin/Admin_ChkLogin.asp,行 122
dim upsql
upsql="update [user] set LastLoginIP='"&fip&"',LastLoginTime='"&now()&"',LoginTimes=LoginTimes+1 where userid="&userid
'response.write "--->"&upsql
'response.end
conn.execute(upsql)
Response.Redirect "index.asp" 展开
[Microsoft][ODBC SQL Server Driver][SQL Server]从字符串转换为 smalldatetime 数据类型时发生语法错误。
/admin/Admin_ChkLogin.asp,行 122
dim upsql
upsql="update [user] set LastLoginIP='"&fip&"',LastLoginTime='"&now()&"',LoginTimes=LoginTimes+1 where userid="&userid
'response.write "--->"&upsql
'response.end
conn.execute(upsql)
Response.Redirect "index.asp" 展开
展开全部
修改update 语槐袜高句, 将当前时间格式好纳化成SQL Server日期时间格式。
dim upsql
dim logintime as string '定义一个变量,用于格式化日期时间字符串
logintime = year(now()) & "-" & month(now()) & "-" & day(now()) & " " & hour(now()) & ":" & minute(now()) & ":" & second(now())
upsql="update [user] set LastLoginIP='"&fip&"铅尺',LastLoginTime='" & logintime &"',LoginTimes=LoginTimes+1 where userid="&userid
dim upsql
dim logintime as string '定义一个变量,用于格式化日期时间字符串
logintime = year(now()) & "-" & month(now()) & "-" & day(now()) & " " & hour(now()) & ":" & minute(now()) & ":" & second(now())
upsql="update [user] set LastLoginIP='"&fip&"铅尺',LastLoginTime='" & logintime &"',LoginTimes=LoginTimes+1 where userid="&userid
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询