Retroceder   Foros del Web > Programación para sitios web > ASP Clásico

Respuesta
 
Herramientas Desplegado
Antiguo 01-jul-2008, 02:59   #1 (permalink)
portillo18 está en el buen camino
 
Fecha de Ingreso: abril-2008
Mensajes: 51
contador en el gobal.asa

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!
__________________
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Publicado por: portillo18
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
portillo18 está desconectado   Responder Citando
Antiguo 01-jul-2008, 04:22   #2 (permalink)
Adler está en el buen camino
 
Avatar de Adler
 
Fecha de Ingreso: diciembre-2006
Mensajes: 542
Respuesta: contador en el gobal.asa

Hola

¿Sabes si tu servidor te permite usa fso?. Consultalo

Suerte
__________________
Nunca has tenido un sábado sangriento??
Adler está desconectado   Responder Citando
Antiguo 01-jul-2008, 04:35   #3 (permalink)
portillo18 está en el buen camino
 
Fecha de Ingreso: abril-2008
Mensajes: 51
Respuesta: contador en el gobal.asa

Gracias Adler!

si el objeto fso esta instalado en el servidor.¿Puede ser algún problema de permisos?
esque si copio el codigo en el Application_OnStart he comprobado que no me da ningun error pero no me vale porque lo correcto seria que estubiera en Session_OnStart



Gracias
__________________
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Publicado por: portillo18
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
portillo18 está desconectado   Responder Citando
Antiguo 01-jul-2008, 13:26   #4 (permalink)
Colaborador
Shiryu_Libra llegará a ser famoso muy prontoShiryu_Libra llegará a ser famoso muy prontoShiryu_Libra llegará a ser famoso muy pronto
 
Avatar de Shiryu_Libra
 
Fecha de Ingreso: febrero-2007
Ubicación: Localhost/Pruebas....
Mensajes: 2.917
Enviar un mensaje por MSN a Shiryu_Libra Enviar un mensaje por Yahoo  a Shiryu_Libra Enviar un mensaje por Skype™ a Shiryu_Libra
Respuesta: contador en el gobal.asa

portillo, cual es tu linea 52? la del FSO, donde intenta realizar la lectura del archivo?

si esta permitido el uso de FSO en tu servidor, pero no tienes permisos de escritura, es por el cual te da error de "permiso denegado"

el permiso de escritura en lugar de realizarlo en la misma carpeta del ROOT, deberias de hacerlo en una carpeta exclusiva para este proposito

por ejemplo
Cita:
tusitio/ <-- ROOT
tusitio/contador/ <--- carpeta exlusiva para tu contador, el cual debera tener permiso de escritura para el usuario IUSR
el server.mappath, deberas cambiarlo a lo siguiente
Cita:
server.mappath("./contador/Contador.txt")
__________________
"Eres parte del problema, parte de la solucion o parte del paisaje"
Un Saludo desde Desierto de Altar, Sonora, MX.
Shiryu_libra
Shiryu_Libra está desconectado   Responder Citando
Antiguo 02-jul-2008, 04:22   #5 (permalink)
portillo18 está en el buen camino
 
Fecha de Ingreso: abril-2008
Mensajes: 51
Respuesta: contador en el gobal.asa

Muchas Gracias!!Era problema de permisos!


Ahora me ha surgido otro problema:

En la página principal a la hora de mostrar el nº de visitas, lo hago pero en numeros romanos, me funcioa en internet explorer pero no en mozilla firefox, les muestro el código:

Cita:
<td width="60%" align="center">
<input type="hidden" value=<%=Application("contador")%> name=numeral size="10" onKeypress="if (event.keyCode<48 || event.keyCode>57) event.returnValue=false;" onblur="this.setAttribute('value', this.value);" maxlength="10">
<img src="udjat.jpg" width="18" height="18">&nbsp;<font color="#CC0033" face="Geneva, Arial, Helvetica, sans-serif, Rockwell"><script language="JavaScript">romanise()</script></font>&nbsp;<img src="udjat_2.jpg" width="18" height="18"></td>
En este lo muestro



La funcion para romanizar es la siguiente:

Cita:
function romanise(){

var persian=numeral.value;
var roman="";
var ronumdashes="";
var buffer=10-persian.length;

while (buffer>0) {persian="0"+persian;buffer--}

var units=new Array("","I","II","III","IV","V","VI","VII","VIII" ,"IX");
var tens=new Array("","X","XX","XXX","XL","L","LX","LXX","LXXX" ,"XC");
var hundreds=new Array("","C","CC","CCC","CD","D","DC","DCC","DCCC" ,"CM");
var thousands=new Array("","M","MM","MMM","MV","V","VM","VMM","VMMM" ,"MX");
var billionsdashes=new Array("","=","==","===","==","=","==","===","====" ,"==");

romandashes=billionsdashes[persian.substring(0,1)];

var hundredmillionsdashes=new Array("","=","==","===","==","=","==","===","====" ,"==");

romandashes+=hundredmillionsdashes[persian.substring(1,2)];

var tenmillionsdashes=new Array("","=","==","===","==","=","==","===","====" ,"==");

romandashes+=tenmillionsdashes[persian.substring(2,3)];

var millionsdashes=new Array("","_","__","___","_=","=","=_","=__","=___" ,"_=");

romandashes+=millionsdashes[persian.substring(3,4)];

var hundredthousandsdashes=new Array("","_","__","___","__","_","__","___","____" ,"__");

romandashes+=hundredthousandsdashes[persian.substring(4,5)];

var tenthousandsdashes=new Array("","_","__","___","__","_","__","___","____" ,"__");

romandashes+=tenthousandsdashes[persian.substring(5,6)];

var thousandsdashes=new Array("","","",""," _","_","_","_","_"," _");

romandashes+=thousandsdashes[persian.substring(6,7)];

roman=thousands[persian.substring(0,1)];

roman+=hundreds[persian.substring(1,2)];

roman+=tens[persian.substring(2,3)];

roman+=thousands[persian.substring(3,4)];

roman+=hundreds[persian.substring(4,5)];

roman+=tens[persian.substring(5,6)];

roman+=thousands[persian.substring(6,7)];

roman+=hundreds[persian.substring(7,8)];

roman+=tens[persian.substring(8,9)];

roman+=units[persian.substring(9,10)];
//este br iria romandashes+"<br>"+roman;


var result = romandashes+roman;

document.write(result);


}
</script>

El problema como mencioné esque en internet explorer me lo muestra correctamente pero en firefox no


Gracias de antemano
__________________
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Publicado por: portillo18
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
portillo18 está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 00:32.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93