Counter
Hei,Jeg lasta ned en teller fra internett, men får den ikke til å virke! Her er koden:
<%
Dim Connection, RS, Page, Counts, MDBfilepath
Page=\"Sirkelens Ende\"
Set Connection=Server.Createobject(\"ADODB.Connection\")
MdbFilePath = Server.MapPath(\"/sirkelensende/db/counter.mdb\")
Connection.Open \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\" & MdbFilePath & \";\"
If Len(Session(Page)) = 0 Then
Set RS = Connection.Execute(\"SELECT * FROM counter WHERE fldPage = \'\" & Page & \"\'\")
If RS.EOF = TRUE Then
Connection.Execute(\"INSERT INTO counter (fldPage, fldCount) VALUES (\'\"&Page&\"\', 0)\")
End If
Set RS = Connection.Execute(\"SELECT * FROM counter WHERE fldPage = \'\" & Page & \"\'\")
Counts=RS(\"fldCount\")+1
Set RS = Connection.Execute(\"UPDATE counter SET fldCount = \" & Counts & \" WHERE fldPage = \'\" & Page & \"\'\")
Session(Page) = \"something\"
Connection.Close
Else
Set RS = Connection.Execute(\"SELECT * FROM counter WHERE fldPage = \'\" & Page & \"\'\")
Counts=RS(\"fldCount\")
End If
Response.Write Counts
%>
Feilmeldingen jeg får er:
Microsoft OLE DB Provider for ODBC Drivers error \'80004005\'
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/sirkelensende/overskrift.asp, line 10
Vet noen hva jeg må gjøre?