Mhtml
03-02-2003, 05:50 AM
Ok, I've been learning python for the last month or so and have run into a problem with my vb code the first day back into web dev.
set conn = server.CreateObject("adodb.connection")
set rs = server.CreateObject("adodb.recordset")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("fpdb/m5i01.mdb") & ";"
'If session("Counted") <> "true" Then
sqlGetCount = "SELECT * FROM Counter"
rs.Open sqlGetCount, conn
If not rs.eof Then
CountNormal = rs("Count")
CountUnique = rs("CountU")
Else
CountNormal = 0
CountUnique = 0
End If
CountNormal = CountNormal + 1
response.write(CountNormal)
If request.Cookies("BeenHere") <> "true" Then
CountUnique = CountUnique + 1
Response.Cookies("BeenHere") = "true"
End If
rs.close
sqlCountIt = "UPDATE Counter SET Count = " & CountNormal & ", CountU = " & CountUnique & " WHERE Count = " & CountNormal - 1
response.Write(sqlCountIt)
rs.Open sqlCountIt, conn
session("Counted") = "true"
'End If
Set rs = nothing
conn.close
set conn = nothing
That should get the number increment it and update the table where the number is equal to that number -1 in the column alas it doesn't seem to update.
set conn = server.CreateObject("adodb.connection")
set rs = server.CreateObject("adodb.recordset")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("fpdb/m5i01.mdb") & ";"
'If session("Counted") <> "true" Then
sqlGetCount = "SELECT * FROM Counter"
rs.Open sqlGetCount, conn
If not rs.eof Then
CountNormal = rs("Count")
CountUnique = rs("CountU")
Else
CountNormal = 0
CountUnique = 0
End If
CountNormal = CountNormal + 1
response.write(CountNormal)
If request.Cookies("BeenHere") <> "true" Then
CountUnique = CountUnique + 1
Response.Cookies("BeenHere") = "true"
End If
rs.close
sqlCountIt = "UPDATE Counter SET Count = " & CountNormal & ", CountU = " & CountUnique & " WHERE Count = " & CountNormal - 1
response.Write(sqlCountIt)
rs.Open sqlCountIt, conn
session("Counted") = "true"
'End If
Set rs = nothing
conn.close
set conn = nothing
That should get the number increment it and update the table where the number is equal to that number -1 in the column alas it doesn't seem to update.