Buenos dias a todos!
Estoy realizando un contador de visitas en mi pagina web, en el global.asa guardo en una variable de session el nº de visitante y a su vez lo guardo tambien en un fichero de texto por si se reinicia el servidor, pues bien el error que me da es el siguiente:
Cita: Error de Microsoft VBScript en tiempo de ejecución error '800a0046'
Permiso denegado
/LM/W3SVC/247121831/Root/global.asa, línea 52
La linea 52 esta dentro del Session_OnStart, que tiene lo siguiente:
Cita: Sub Session_OnStart
'Abre la conexion con la base de datos
'Reservas.Open (Application("ConexionStringCasas"))
Reservas.Open ("Provider=SQLOLEDB; Data Source=192.168.1.101; Initial Catalog=db_Reservas; User Id=sa; Password=LE6260ZBNW;")
'abro bbdd db_reservasinvitado
ReservasInvitado.Open ("Provider=SQLOLEDB; Data Source=192.168.1.101; Initial Catalog=db_ReservasInvitado; User Id=sa; Password=LE6260ZBNW;")
' Create a server object
set fso = createobject("scripting.filesystemobject")
' Target the text file to be opened
set act = fso.opentextfile(server.mappath("Contador.txt"))
' Read the value of the text document
' If the text document does not exist then the on error resume next
' will drop down to the next line
counter = clng(act.readline)
' Add one to the counter
counter = counter + 1
' Close the object
act.close
' Create a new text file on the server, esta es la linea 52 \/ donde me da el error
Set act = fso.CreateTextFile(server.mappath("Contador.txt"), true)
' Write the current counter value to the text document
act.WriteLine(Application("contador"))
Application("contador")=counter
' Close the object
act.Close
Session("Start") = Now()
Session.TimeOut = 100
End Sub
No se porque será!!
espero que puedan ayudarme, es urgente gracias!