<%
ip = Request.ServerVariables("REMOTE_ADDR")
getInfos os, browser
Session.LCID = 1033
dateLimit = DateAdd("n", -1 * dk_g, Now())
Set checkForIp = objConn.Execute("SELECT * FROM ZIYARETCI WHERE IP = '"& ip &"'")
If Session("Oturum") <> "Acik" Then
If checkForIp.EOF Then
Set addIP = Server.CreateObject("ADODB.RecordSet")
addIP.Open "SELECT * FROM ZIYARETCI", objConn, 3, 3
addIP.AddNew
addIP("IP") = ip
addIP("TARIH") = Date()
addIP("OS") = os
addIP("BROWSER") = browser
addIP.Update
Else
Set updIP = objConn.Execute("UPDATE ZIYARETCI SET TARIH = "& Now() &" WHERE IP = '"& ip &"'")
Set updOS = objConn.Execute("UPDATE ZIYARETCI SET OS = '"& os &"' WHERE IP = '"& ip &"'")
Set updBR = objConn.Execute("UPDATE ZIYARETCI SET BROWSER = '"& browser &"' WHERE IP = '"& ip &"'")
End If
Else
Set updtIP = objConn.Execute("UPDATE UYELER SET L_IP = '"& ip &"' WHERE U_ID = "& Session("Uye_Id"))
Set updtOS = objConn.Execute("UPDATE UYELER SET OS = '"& os &"' WHERE U_ID = "& Session("Uye_Id"))
Set updtBR = objConn.Execute("UPDATE UYELER SET BROWSER = '"& browser &"' WHERE U_ID = "& Session("Uye_Id"))
End If
Set delIP = objConn.Execute("DELETE FROM ZIYARETCI WHERE TARIH <= #"&dateLimit&"#")
Set objTotals = Server.CreateObject("ADODB.RecordSet")
objTotals.Open "SELECT * FROM ZIYARETCI WHERE TARIH >= #"&dateLimit&"# ORDER BY TARIH DESC", objConn, 3, 3
total = objTotals.RecordCount
Session.LCID = lcid
Session.LCID = 1033
dateToProcess = DateAdd("d", -1 * 3, Now())
Set delOldMems = objConn.Execute("DELETE FROM UYELER WHERE ACTIVE = 0 AND P_ADMIN = 0 AND U_TARIHI < #"&dateToProcess&"#")
Session.LCID = lcid
If Session("Oturum") = "Acik" Then
Session.LCID = 1033
Set UpdDate = objConn.Execute("UPDATE UYELER SET SON_TARIH=#"&NOW()&"# WHERE U_ID="&Session("Uye_Id")&"")
Session.LCID = lcid
Set objLevel = objConn.Execute("SELECT * FROM UYELER WHERE U_ID = "& Session("Uye_Id"))
If Not objLevel.EOF Then
If objLevel("SEVIYE") = 0 Then
Session("Uye_Seviye") = "0"
ElseIf objLevel("SEVIYE") = 1 Then
Session("Uye_Seviye") = "1"
Else
Session("Uye_Seviye") = "0"
End If
End If
End If
Function editBr(str)
str = Replace (str, vbCrLf, "<br>", 1, -1, 1)
editBr = str
End Function
Function duz(Str)
Str = Replace(Str, "<", "<", 1, -1, 1)
Str = Replace(Str, ">", ">", 1, -1, 1)
Str = Replace(Str, vbCrLf, "<br>", 1, -1, 1)
Str = Replace(Str, " ", " ", 1, -1, 1)
Str = Replace(Str, " ", " ", 1, -1, 1)
duz = Str
End Function
%>
-------------------------------------------------------------------------------------------------------
This code sometimes work sometimes not.... The line which is caused to trouble is red line. And the error statement is this :
"Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '6/19/2004 12:38:17 AM'.
/web/site/dahil.asp, line 102"
(Red Line is line 102)
When it comes to my question how could be this code snippet or page sometime works and sometime does not work, i cant understand ?
If you assist to me i will be grateful...
Thank for everything from now...