I used to use the following code to update some table statistics when users login to a page. My old database was Access 2k3 and everything ran fine. Now I'm getting this error since I've migrated to SQL Server 2005.
Quote:
Microsoft SQL Native Client error '80040e14'
Incorrect syntax near '4'.
/TRWebSQL/Ownership_Reportreport.asp, line 401
|
The line it refers to is
Code:
<% 'Update Owner Visit
sSessionStatus = Session(ewSessionStatus)
sSessionUserName = Session(ewSessionUserName)
sRemoteAddress = Request.ServerVariables("REMOTE_ADDR")
sHTTP_UserAgent = Request.ServerVariables("HTTP_USER_AGENT")
dCurrentTime = Now()
If sSessionStatus = "login" Then
If LEN(sRemoteAddress) > 0 AND LEN(sHTTP_UserAgent) > 0 Then
strSQL = "UPDATE OWNERS " & _
"SET Visits = Visits + 1, " & _
"LastLogin = #" & dCurrentTime & "#, " & _
"RemoteAddr = '" & sRemoteAddress & "', " & _
"HttpUserAgent = '" & sHTTP_UserAgent & "' " & _
"WHERE Access_Code = '" & sSessionUserName & "';"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str
conn.Execute (strSQL)
conn.Close
Set conn = Nothing
Set strSQL = Nothing
End If
End If
%>