Ir para conteúdo

POWERED BY:

Arquivado

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

alison parreira

erro Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)

Recommended Posts

ola boa tarde..

no formulario de exclusao por checkbox ta dando esse erro nao to entendo pq. sera q da pra alguem me ajudar dando uma olhada no meu codigo?

obrigado

 

<%Dim rs_osDim rs_os_numRowsSet rs_os = Server.CreateObject("ADODB.Recordset")rs_os.ActiveConnection = MM_consme_STRINGrs_os.Source = "SELECT * FROM tb_os ORDER BY id_os ASC"rs_os.CursorType = 0rs_os.CursorLocation = 2rs_os.LockType = 1rs_os.Open()rs_os_numRows = 0%>[b]<%dim numdim letra dim palavradim sqlpalavra="" letra=split(request.querystring("checkbox"),",",-1,1) for each num in letra if palavra <>"" then palavra = palavra & " or " palavra = palavra & "id_os=" & num next sql="DELETE FROM tb_os WHERE " sql=sql & palavra%><%set cmd = Server.CreateObject("ADODB.Command")cmd.ActiveConnection = MM_consme_STRINGcmd.CommandText = sqlcmd.CommandType = 1cmd.CommandTimeout = 0cmd.Prepared = truecmd.Execute()Response.Redirect("principal.asp")%>[/b]<%Dim Repeat1__numRowsDim Repeat1__indexRepeat1__numRows = -1Repeat1__index = 0rs_os_numRows = rs_os_numRows + Repeat1__numRows%><%Dim MM_paramName %><%' *** Go To Record and Move To Record: create strings for maintaining URL and Form parametersDim MM_keepNoneDim MM_keepURLDim MM_keepFormDim MM_keepBothDim MM_removeListDim MM_itemDim MM_nextItem' create the list of parameters which should not be maintainedMM_removeList = "&index="If (MM_paramName <> "") ThenMM_removeList = MM_removeList & "&" & MM_paramName & "="End IfMM_keepURL=""MM_keepForm=""MM_keepBoth=""MM_keepNone=""' add the URL parameters to the MM_keepURL stringFor Each MM_item In Request.QueryStringMM_nextItem = "&" & MM_item & "="If (InStr(1,MM_removeList,MM_nextItem,1) = 0) ThenMM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))End IfNext' add the Form variables to the MM_keepForm stringFor Each MM_item In Request.FormMM_nextItem = "&" & MM_item & "="If (InStr(1,MM_removeList,MM_nextItem,1) = 0) ThenMM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))End IfNext' create the Form + URL string and remove the intial '&' from each of the stringsMM_keepBoth = MM_keepURL & MM_keepFormIf (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)End IfIf (MM_keepURL <> "") ThenMM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)End IfIf (MM_keepForm <> "") ThenMM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)End If' a utility function used for adding additional parameters to these stringsFunction MM_joinChar(firstItem)If (firstItem <> "") ThenMM_joinChar = "&"ElseMM_joinChar = ""End IfEnd Function%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><table width="572" height="565" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" valign="top"> <p> </p><form name="form1" method="post" action=""><table width="98%" border="0" cellspacing="0" cellpadding="0"><tr><td width="15%">Numero O.S </td><td width="36%">Cliente</td><td width="31%">Equipamento</td><td>Data</td><td>Del</td></tr><% While ((Repeat1__numRows <> 0) AND (NOT rs_os.EOF)) %><tr><td><%=(rs_os.Fields.Item("os").Value)%></td><td><%=(rs_os.Fields.Item("cliente").Value)%><A HREF="detalhes_os.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "id_os=" & rs_os.Fields.Item("id_os").Value %>">_Exibir</A>__<A HREF="atualiza_os.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "id_os=" & rs_os.Fields.Item("id_os").Value %>">Alterar</A></td><td><%=(rs_os.Fields.Item("equipamento").Value)%></td><td width="14%"><%=(rs_os.Fields.Item("data").Value)%></td><td width="4%"><input type="checkbox" name="checkbox" value="<%=rs_os("id_os")%>"></td></tr><tr><td> </td><td>  </td><td> </td><td colspan="2"> </td></tr><% Repeat1__index=Repeat1__index+1Repeat1__numRows=Repeat1__numRows-1rs_os.MoveNext()Wend%></table><p><input name="excluir selecionada" type="submit" id="excluir selecionada" value="Submit"></p></form><p>  </p></td></tr></table></body></html><%rs_os.Close()Set rs_os = Nothing%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Camarada,

 

Troque:

sql="DELETE FROM tb_os WHERE "sql=sql & palavra

Por:

sql="DELETE FROM tb_os WHERE  CAMPO_PALAVRA '"sql=sql & palavra & "'"

Ficou faltando o nome do campo da tabela para efetuar o filtro no where.

E não se esqueça dos ' (plics) pois o campo e string.

 

t+

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.