Ver Mensaje Individual
  #12 (permalink)  
Antiguo 15/06/2005, 13:36
Avatar de speedy
speedy
 
Fecha de Ingreso: octubre-2004
Ubicación: México
Mensajes: 127
Antigüedad: 20 años, 6 meses
Puntos: 0
Hola Myakire,

Ya hice lo que me dijiste asi quedo:

Código:
<script language="JavaScript">
<!--hide
DatosCliente = new Array();

<% Set adoCon = Server.CreateObject("ADODB.Connection") %>
<% Set rs = Server.CreateObject("ADODB.Recordset")	 %>
<% adoCon.Open "DSN=BDSistema;" %>

<% vSQL = "Select * from Usuarios ORDER BY IdUsuario" %>
<% rs.Open vSQL, adoCon %>
<% Cnt = 0 %>
<%     While Not rs.EOF %>
		  
      DatosCliente[<%=Cnt%>] = new Array();
	  DatosCliente[<%=Cnt%>][0]= "<%=Trim(rs("IdUsuario"))%>";
	  DatosCliente[<%=Cnt%>][1]= "<%=Trim(rs("Tipo"))%>";
	  DatosCliente[<%=Cnt%>][2]= "<%=Trim(rs("Nombre"))%>";
<%      Cnt = Cnt + 1 %>
<% 		rs.MoveNext %>
<% 	Wend %>
//-->
</script>
Código:
<script language="JavaScript">
<!--hide
function ActualizaCampos(Sub){
	document.form1.IdUsuario.value = DatosCliente[Sub][0]
	document.form1.Tipo.value = DatosCliente[Sub][1]
	document.form1.Nombre.value = DatosCliente[Sub][2]
}
	
//-->
</script>
Código:
<body onLoad="ActualizaCampos(Sub)">
<form name="form1" method="post" action="">
  <p>
    Id:
    <input type="text" name="IdUsuario">
  </p>
  <p>    Tipo: 
    <input type="text" name="Tipo">
  </p>
  <p>    Nombre: 
    <input type="text" name="Nombre">
      </p>
</form>
No se pinta el primer registro en las caja de texto (Aun no llego al clic del Boton), pero esto es lo que sale:



Esta es la linea que se menciona en el error:



La cosa es en si no se mucho de JavaScript como podras imaginarte y no se como definir el Sub

Si quito los meta de JavaScript si se pinta en pantalla esto:

Código:
DatosCliente = new Array(); DatosCliente[0] = new Array(); DatosCliente[0][0]= "1"; DatosCliente[0][1]= "Administrador"; DatosCliente[0][2]= "Luis Edgar"; DatosCliente[1] = new Array(); DatosCliente[1][0]= "2"; DatosCliente[1][1]= "Administrador"; DatosCliente[1][2]= "armando"; DatosCliente[2] = new Array(); DatosCliente[2][0]= "3"; DatosCliente[2][1]= "Administrador"; DatosCliente[2][2]= "gerardo"; DatosCliente[3] = new Array(); DatosCliente[3][0]= "4"; DatosCliente[3][1]= "Administrador"; DatosCliente[3][2]= "carlos"; DatosCliente[4] = new Array(); DatosCliente[4][0]= "5"; DatosCliente[4][1]= "Administrador"; DatosCliente[4][2]= "marco"; DatosCliente[5] = new Array(); DatosCliente[5][0]= "6"; DatosCliente[5][1]= "Administrador"; DatosCliente[5][2]= "israel"; DatosCliente[6] = new Array(); DatosCliente[6][0]= "7"; DatosCliente[6][1]= "Administrador"; DatosCliente[6][2]= "fernando"; DatosCliente[7] = new Array(); DatosCliente[7][0]= "8"; DatosCliente[7][1]= "Administrador"; DatosCliente[7][2]= "alejandro"; DatosCliente[8] = new Array(); DatosCliente[8][0]= "9"; DatosCliente[8][1]= "Administrador"; DatosCliente[8][2]= "Francisco"; DatosCliente[9] = new Array(); DatosCliente[9][0]= "10"; DatosCliente[9][1]= "Usuario"; DatosCliente[9][2]= "jose"; DatosCliente[10] = new Array(); DatosCliente[10][0]= "11"; DatosCliente[10][1]= "Vendedor"; DatosCliente[10][2]= "luise"; DatosCliente[11] = new Array(); DatosCliente[11][0]= "12"; DatosCliente[11][1]= "Cliente"; DatosCliente[11][2]= "julio";
La cosa en ese Sub...
__________________
Saludos :cool: y Suerte :arriba:
valle del mezquital en el Estado de Hidalgo