Ciao ragazzi,
sto cercando di far funzionare quel cavolo di sistema di statistiche del "Statcountex"...

va tutto, tranne nella pagina "admin.asp", che trovo un errore, non mi aggiorna i dati quando
voglio modificare...

le ho provate tutte e siccome non sono arrivato ancora al sodo, vi chiedo aiuto...

Tipo errore:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

/Ceramica/statcountex/admin.asp, line 56


----------------------
Pagina "admin.asp":
----------------------


<!--#include file="config.asp"-->
<%
'-------------------------------------------------------------
'StatCounteX 3.1
'http://www.2enetworx.com/dev/projects/statcountex.asp

'File: admin.asp
'Description: StatCounteX Reports Main Page
'Initiated by FlipDaMusic on Feb 20, 2001

'See credits.txt for the list of contributors

'You may use the code for any purpose
'But re-publishing is discouraged.
'
'-------------------------------------------------------------
'Change Log:
'-------------------------------------------------------------

if Request.Form("Method") = "change" then

'open DB Connection
OpenDB sConnStats


'Mia query
strSql = "UPDATE Config SET " &_
"C_ImageLoc ='" & Request.Form("ImageLocation") & "', " &_
"C_FilterIP='" & Request.Form("FilterIPs") & "', " &_
"C_Showlinks=" & Request.Form("ShowLinks") & ", " &_
"C_RefThisServer=" & Request.Form("CountServer") & ", " &_
"C_StripPathParameters=" & Request.Form("PathParameters") & ", " &_
"C_StripPathProtocol=" & Request.Form("PathProtocol") & ", " &_
"C_StripRefParameters=" & Request.Form("RefParameters") & ", " &_
"C_StripRefProtocol=" & Request.Form("RefProtocol") & ", " &_
"C_StripRefFile=" & Request.Form("RefFile") & " WHERE " &_
"ID=" & 1



'Response.Write(strsql)
'Response.end
conn.Execute(strSql)

'conn.close
'set conn = nothing


%>

----------------------
Pagina "config.asp":
----------------------


<%
'-------------------------------------------------------------
'StatCounteX 3.1
'http://www.2enetworx.com/dev/projects/statcountex.asp

'File: admin.asp
'Description: StatCounteX Reports Main Page
'Initiated by Hakan Eskici on Nov 18, 2000

'See credits.txt for the list of contributors

'You may use the code for any purpose
'But re-publishing is discouraged.
'See License.txt for additional information

'-------------------------------------------------------------
'Change Log:
'-------------------------------------------------------------
'# Feb 25, 2001 by Rami Kattan
'WindowsME can be counted now (database file need a new entry in OSes: OsName= WinMe, OsId = 8
'Netscape 6.x is reported as NS 6.x

'# Feb 20, 2001 by FlipDaMusic
'Future Support for SQL6, SQL7, Access 2000, Access97 (not fully implemented)
'Add Loading of Config Variables

'# Feb 5, 2001 by Kevin Yochum
'Added IP filter to ignore hits from specified visitor IP's
'Added configuration switch to display url's as active links
'-------------------------------------------------------------

'-------------------------------------------------
'You don't need to modify anything below this line.
'-------------------------------------------------

'Construct the connection string

'## Make sure to uncomment one of the sConnStats lines!
'## MS Access 97
'sConnStats = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\inetpub\wwwroot\scx\stats.mdb"

'## MS Access 2000 using virtual path
'sConnStats = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("stats.mdb")
sConnStats = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("stats.mdb")

'## MS Access 2000
'sConnStats = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=;"

'## MS SQL Server 7
'sConnStats = "driver={SQL Server};server=SERVERNAME;uid=USERNAME;pwd=PASSWORD;database=DATABASENAME"


'Pre Create the connection and recordset objects
set conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")

'ADO Constants
'---- CursorTypeEnum Values ----
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3

'---- CursorLocationEnum Values ----
Const adUseServer = 2
Const adUseClient = 3

'---- CommandTypeEnum Values ----
Const adCmdUnknown = &H0008
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004
Const adCmdFile = &H0100
Const adCmdTableDirect = &H0200

sub OpenDB(sconn)
'Opens the given connection and initializes the recordset
conn.open sConnStats
set rs.ActiveConnection = conn
rs.CursorType = adOpenStatic
end sub

sub CloseDB()
'Closes and destroys the connection and recordset objects
rs.close
conn.close
set rs = nothing
set conn = nothing
end sub

sub w(sText)
'A Quickie ;)
response.write sText & vbCrLf
end sub

'Load Config from DB

'Open Connection
conn.open sConnStats

'Build SqlString
strSql = "SELECT C_ImageLoc "
strSql = strSql & ", C_FilterIP "
strSql = strSql & ", C_ShowLinks "
strSql = strSql & ", C_RefThisServer "
strSql = strSql & ", C_StripPathParameters "
strSql = strSql & ", C_StripPathProtocol "
strSql = strSql & ", C_StripRefParameters "
strSql = strSql & ", C_StripRefProtocol "
strSql = strSql & ", C_StripRefFile "
strSql = strSql & "FROM Config WHERE ID = 1"

'Open RecordSet
set rs = conn.Execute(strSql)

'Get Variables
sImageLocation = rs.Fields("C_ImageLoc")
sFilterIps = rs.Fields("C_FilterIP")
bShowLinks = rs.Fields("C_ShowLinks")
bRefThisServer = rs.Fields("C_RefThisServer")
bStripPathParameters = rs.Fields("C_StripPathParameters")
bStripPathProtocol = rs.Fields("C_StripPathProtocol")
bStripRefParameters = rs.Fields("C_StripRefParameters")
bStripRefProtocol = rs.Fields("C_StripRefProtocol")
bStripRefFile = rs.Fields("C_StripRefFile")


'Terminate database connection
rs.Close
conn.close

%>


Cosa non va?!?

Grazie è urgente!!


-------------------------------------
http://www.teodesign.com
-------------------------------------
1.605 messaggi dal 06 settembre 2002
leggi questa F.A.Q.

http://www.aspitalia.com/newsgroup/faq.asp?ID=51

FORZA LA MAGICA ROMA

FORZA LA MAGICA ROMA
27 messaggi dal 02 gennaio 2002
Ho visto che è urgente...non ho letto il tuo codice quindi probabilmente non sarà così però non si sa mai.

Hai controllato che il tuo db (file.mdb) non sia in read only?
E hai fatto la stessa cosa per la tabella? Hai i permessi di scrittura su quella tabella?

Sicuramente avrai già controllato queste cose...quindi ora cerco un altra soluzione.

---Teo---

---Teo---

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.