Nope im not the pikachew you know..
Im from Singapore.
Here is another similar function im using
*********************************
function GetIdB(sB)
sUserID = Request("UserID")
sSQL = "SELECT WsID, WsName, Total, UserID FROM WinSize WHERE UserID = '"&sUserID&"' AND WsName = '" & sName & "'"
rs.Open sSQL,,,adCmdTable
if rs.eof then
rs.AddNew
rs("WsName") = sName
rs("Total") = 0
rs("UserID") = sUserID
end if
rs("Total") = rs("Total") + 1
rs.update
GetIdWinSize = rs("WsID")
rs.close
end function
****************************************
Lets jus say this is Function B, that updates Table B
the previous function is A that updates Table A
And you are right to say that they can hit simultaneously
**********************************************************
If you have two simultaneous visitors, the two visitors may read the valeur in, let say, Table D. Both receive 6, and both update the total to seven.
Since it happens in a split second, the total may be ok in other tables.
*********************************************************
But each visitor will cause all the tables to be updated at the same time doesnt it?
I mean we are down to a difference in seconds, does MS Access know how to differentiate between which one comes 1st.
Actually im the one testing the program now, i actually hit my site at a interaval of 1 or 2 second, which is almost concurrent but there is still a time lapse, however im still getting a loss of counts in some tables
Here is how the functions are called
**************************************************
'Open the database
OpenDB sConnStats
'Get ID's by Names
lIdA = GetIdA(sA)
lIdB = GetIdB(sB)
lIdC = GetIdC(sC)
lIdD = GetIdD(sD)
lIdE = GetIdE(sE)
lIdF = GetIdF(sF)
lIdG = GetIdG(sG)
******************************************************
This function updates a separate type of table different from the rest
******************************************************
sSQL = "SELECT * FROM Stats WHERE UserID = '"&sUserID&"'"
rs.Open sSQL,,,adCmdTable
'Save the data
rs.AddNew
rs("JaID") = lIdJa
rs("JsID") = lIdJs
rs("CookieID") = lIdCookie
rs("LanID") = lIdLan
rs("OsID") = lIdOS
rs("ColorID") = lIdColor
rs("BrowserID") = lIdBrowser
rs("PathID") = lIdPath
rs("RefID") = lIdRef
rs("ResID") = lIdRes
rs("WsID") = lIdWs
rs("Date") = Date
rs("Time") = Time
'rs("Time") = FormatDateTime(Now(), vbLongTime)
rs("IP") = sIP
rs("Country") = sCountry
rs("UserID") = sUserID
rs.Update
'Terminate database connection
CloseDB
*******************************************************
So this means that whenever a visitor visits my site, all this functions will be called and the Tables involved will be updated appropriately.
However after a few days, when the data bulits up
I get varying "Total"s from the Tables
Table A "Total" = 567
Table B "Total" = 566
Table C "Total" = 567
Table D "Total" = 566
Table E "Total" = 567
Table F "Total" = 565
Table G "Total" = 567