Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

graffdesign

atualizar um banco de dados

Recommended Posts

Olá galéra você breve...

Fiz um formulário que atualiza uma tabela de uma base de dados, fiz todos os procedimentos, aparece todos os registros tudo normal, só que quando envio o formulário da esse erro;

 

"Informações técnicas (para a equipe de suporte)

 

Tipo de erro:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

[Microsoft][Driver ODBC para Microsoft Access] A operação deve usar uma consulta atualizável.

/mysites/evangelink/web/intranet/TMPmzpokjuwas.asp, line 111

 

 

Tipo de navegador:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

 

Página:

POST 343 bytes to /mysites/evangelink/web/intranet/TMPmzpokjuwas.asp

 

POST Data:

filme=Exterminador+3&ator=Shuazeneger&horario1=17%3A00%3A00&horario2=19%3A00%3A00&horario3=21%3A00%3A00&sinopse=Continua%E7%E3o+da+t%E3o+famosa+s%E9rie+de+filmes+de+a%E7%E3o+Terminator%2C+um+dos+filme . . . "

 

 

Vo enviar meu código será que tem como vocês darem uma olhada?

 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!--#include file="../../Connections/evangelink.asp" --><%' *** Edit Operations: declare variablesDim MM_editActionDim MM_abortEditDim MM_editQueryDim MM_editCmdDim MM_editConnectionDim MM_editTableDim MM_editRedirectUrlDim MM_editColumnDim MM_recordIdDim MM_fieldsStrDim MM_columnsStrDim MM_fieldsDim MM_columnsDim MM_typeArrayDim MM_formValDim MM_delimDim MM_altValDim MM_emptyValDim MM_iMM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))If (Request.QueryString <> "") Then  MM_editAction = MM_editAction & "?" & Request.QueryStringEnd If' boolean to abort record editMM_abortEdit = false' query string to executeMM_editQuery = ""%><%' *** Update Record: set variablesIf (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then  MM_editConnection = MM_evangelink_STRING  MM_editTable = "cine1"  MM_editColumn = "filme"  MM_recordId = "'" + Request.Form("MM_recordId") + "'"  MM_editRedirectUrl = "atualizado_cinema.asp"  MM_fieldsStr  = "filme|value|ator|value|horario1|value|horario2|value|horario3|value|sinopse|value"  MM_columnsStr = "filme|',none,''|ator|',none,''|horario1|',none,NULL|horario2|',none,NULL|horario3|',none,NULL|sinopse|',none,''"  ' create the MM_fields and MM_columns arrays  MM_fields = Split(MM_fieldsStr, "|")  MM_columns = Split(MM_columnsStr, "|")    ' set the form values  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))  Next  ' append the query string to the redirect URL  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString    Else      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString    End If  End IfEnd If%><%' *** Update Record: construct a sql update statement and execute itIf (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then  ' create the sql update statement  MM_editQuery = "update " & MM_editTable & " set "  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2    MM_formVal = MM_fields(MM_i+1)    MM_typeArray = Split(MM_columns(MM_i+1),",")    MM_delim = MM_typeArray(0)    If (MM_delim = "none") Then MM_delim = ""    MM_altVal = MM_typeArray(1)    If (MM_altVal = "none") Then MM_altVal = ""    MM_emptyVal = MM_typeArray(2)    If (MM_emptyVal = "none") Then MM_emptyVal = ""    If (MM_formVal = "") Then      MM_formVal = MM_emptyVal    Else      If (MM_altVal <> "") Then        MM_formVal = MM_altVal      ElseIf (MM_delim = "'") Then  ' escape quotes        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"      Else        MM_formVal = MM_delim + MM_formVal + MM_delim      End If    End If    If (MM_i <> LBound(MM_fields)) Then      MM_editQuery = MM_editQuery & ","    End If    MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal  Next  MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId  If (Not MM_abortEdit) Then    ' execute the update    Set MM_editCmd = Server.CreateObject("ADODB.Command")    MM_editCmd.ActiveConnection = MM_editConnection    MM_editCmd.CommandText = MM_editQuery    MM_editCmd.Execute    MM_editCmd.ActiveConnection.Close    If (MM_editRedirectUrl <> "") Then      Response.Redirect(MM_editRedirectUrl)    End If  End IfEnd If%><%Dim Recordset1Dim Recordset1_numRowsSet Recordset1 = Server.CreateObject("ADODB.Recordset")Recordset1.ActiveConnection = MM_evangelink_STRINGRecordset1.Source = "SELECT * FROM cine1"Recordset1.CursorType = 0Recordset1.CursorLocation = 2Recordset1.LockType = 1Recordset1.Open()Recordset1_numRows = 0%><html><head><title>Intranet Evangelink.com Área Restrita aos Administradores</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="css/style_intranet.css" rel="stylesheet" type="text/css"></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><div align="center">  <table width="600" border="0" cellspacing="0" cellpadding="0">    <tr>      <td valign="top">  <form method="POST" action="<%=MM_editAction%>" name="form1">          <table align="center">            <tr valign="baseline" bgcolor="#006699">               <td colspan="2" align="right" valign="middle" nowrap><div align="center"><font color="#FFFFFF">FORMULÁRIO                   DE ATUALIZAÇÃO DE REGISTROS DE CINE MACAÉ                   1</font></div></td>            </tr>            <tr valign="baseline">               <td width="60" align="right" valign="middle" nowrap>Filme:</td>              <td width="320" valign="middle"> <input type="text" name="filme" value="<%=(Recordset1.Fields.Item("filme").Value)%>" size="50">               </td>            </tr>            <tr valign="baseline">               <td align="right" valign="middle" nowrap>Ator:</td>              <td valign="middle"> <input type="text" name="ator" value="<%=(Recordset1.Fields.Item("ator").Value)%>" size="50">               </td>            </tr>            <tr valign="baseline">               <td align="right" valign="middle" nowrap>Horario1:</td>              <td valign="middle"> <input type="text" name="horario1" value="<%=(Recordset1.Fields.Item("horario1").Value)%>" size="50">               </td>            </tr>            <tr valign="baseline">               <td align="right" valign="middle" nowrap>Horario2:</td>              <td valign="middle"> <input type="text" name="horario2" value="<%=(Recordset1.Fields.Item("horario2").Value)%>" size="50">               </td>            </tr>            <tr valign="baseline">               <td align="right" valign="middle" nowrap>Horario3:</td>              <td valign="middle"> <input type="text" name="horario3" value="<%=(Recordset1.Fields.Item("horario3").Value)%>" size="50">               </td>            </tr>            <tr valign="baseline">               <td align="right" valign="middle" nowrap> <div align="right">Sinopse:</div></td>              <td> <textarea name="sinopse" id="sinopse"><%=(Recordset1.Fields.Item("sinopse").Value)%></textarea>               </td>            </tr>            <tr valign="baseline">               <td nowrap align="right"> </td>              <td> <input type="submit" value="Enviar">   <input type="reset" name="Submit" value="Limpar">               </td>            </tr>          </table>          <input type="hidden" name="MM_update" value="form1">          <input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("filme").Value %>">        </form>        <p> </p></td>    </tr>  </table></div></body></html><%Recordset1.Close()Set Recordset1 = Nothing%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

KRA você PRECISA LIBERAR A PASTA DO BD PARA GRAVAÇÃO... NO IIS DO SERVIDOR, NAS PROPRIEDADES DO DIRETÓRIO VIRTUAL DO SITE MARQUE A OPCÃO DE GRAVAR... DEVE SER ISTU!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.