
09/01/2008, 12:58
|
| | Fecha de Ingreso: enero-2008
Mensajes: 5
Antigüedad: 17 años, 4 meses Puntos: 0 | |
Re: Ayuda para actualizar tabla en access con un formulario de region repetida Hola, este es el codigo del archivo en donde tengo la tabla con la region repetida
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_whoiswho_mig2_STRING
Recordset1.Source = "SELECT * FROM data where id_htc=13 and id_class='2007b'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<form name="form1" method="post" action="grades_insert_ph1.asp">
<table width="650" border="1">
<tr>
<td>Id</td>
<td>SAP</td>
<td>FIRSTNAME</td>
<td>LASTNAME</td>
<td>RED BOOK</td>
<td>HYD</td>
<td>PIZZA</td>
<td>G_R</td>
<td>DLG</td>
<td>LOG</td>
<td>CMT</td>
<td>CPS</td>
<td>PE</td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td><label></label>
<input name="id" type="text" id="id" value="<%=(Recordset1.Fields.Item("id").Value)%>" size="4" readonly="true"></td>
<td><%=(Recordset1.Fields.Item("sap").Value)%></td>
<td><%=(Recordset1.Fields.Item("fname").Value)%> </td>
<td><%=(Recordset1.Fields.Item("lname").Value)%> </td>
<td><label>
<input name="rb" type="text" id="rb" value="<%=(Recordset1.Fields.Item("red_book").Valu e)%>" size="4" maxlength="4">
</label></td>
<td><input name="hyd" type="text" id="hyd" value="<%=(Recordset1.Fields.Item("hydraulics").Va lue)%>" size="4" maxlength="4"/></td>
<td><input name="pizza" type="text" id="pizza" value="<%=(Recordset1.Fields.Item("pizza").Value)% >" size="4" maxlength="4"/></td>
<td><input name="geology" type="text" id="geology" value="<%=(Recordset1.Fields.Item("g_r").Value)%>" size="4" maxlength="4"/></td>
<td><input name="dlg" type="text" id="dlg" value="<%=(Recordset1.Fields.Item("dlg").Value)%>" size="4" maxlength="4" /></td>
<td><input name="log" type="text" id="log" value="<%=(Recordset1.Fields.Item("log").Value)%>" size="4" maxlength="4"/></td>
<td><input name="cmt" type="text" id="cmt" value="<%=(Recordset1.Fields.Item("cmt").Value)%>" size="4" maxlength="4" /></td>
<td><input name="cps" type="text" id="cps" value="<%=(Recordset1.Fields.Item("cps").Value)%>" size="4" maxlength="4" /></td>
<td><input name="pe" type="text" id="pe" value="<%=(Recordset1.Fields.Item("pe").Value)%>" size="4" maxlength="4" /></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
<p>
<label>
<input type="submit" name="Submit" value="Submit">
</label>
</p>
</form>
<p> </p>
<p>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
</p>
Este es el archivo que recibe los valores y que debe hacer la actualizacion en la base de datos
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim oConn
set oConn=Server.CreateObject("ADODB.Connection")
oConn.Open="Driver=Microsoft Access Driver (*.mdb); DBQ=" & Server.MapPath("database") & "\whoiswho_mig2.mdb;"
arreglo = request("id")
arreglo = split(arreglo,",")
total = ubound(arreglo)
for x=0 to total
response.write arreglo(x)
next
arreglo1 = request("geology")
arreglo1 = split(arreglo1,",")
total1 = ubound(arreglo1)
for x=0 to total1
response.write arreglo1(x)
next
set oConn = Server.CreateObject("ADODB.Connection") ' conexion
oConn.Open "Driver=Microsoft Access Driver (*.mdb); DBQ=" & Server.MapPath("database") & "\whoiswho_mig2.mdb;" SQL="UPDATE data SET g_r="&arreglo1&" where id="&arreglo&";" LINEA 30 EN DONDE ENVIA ERROR
set rs= oConn.Execute(SQL)
Set oConn = nothing
%>
Me manda el siguiente error
Microsoft VBScript runtime error '800a000d'
Type mismatch
/esg/esghrd_tec/esghrd_tec_content/utilization/grades_insert_ph1.asp, line 30 |