Ir para conteúdo

POWERED BY:

Arquivado

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

augusto.braga

Erro '80040e14'

Recommended Posts

Galera, estou tendo problemas com esse erro alguém poderia me ajudar!!!O erro esta acontecendo tanto na edição, como na Exclusão de dados no guestbook!A mensagem eh a seguinte:Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'mensagem_ID = , 87'. /viacorpo/admin/detalhes.asp, line 111 Agradeço desde já.

Compartilhar este post


Link para o post
Compartilhar em outros sites

ooooow loko,entao axo q o erro esta acontecendo por causa q quando você passa a ID pra ser excluida esta indo uma virgula junto....falooowww

Compartilhar este post


Link para o post
Compartilhar em outros sites

Isso mesmo...

da uma olhada no 'mensagem_ID = , 87'.

 

ele teria que retornar algo do tipo : 'mensagem_ID = '87'

 

a aspa simples ao inves da virgula

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ai galera obrigado pela ajuda...

desculpem pela minha desatenção quanto a isso!!! Mas, não consegui achar no código onde poderia estar esse erro... alguém poderia me ajudar, segue logo abaixo o código!

Estou colocando o códio todo por não saber ao certo onde se encontra esse script pois fiz no dream weaver

 

Agradeço desde já

 

 

<%@LANGUAGE="VBSCRIPT"%>

<!--#include file="../Connections/connViaCorpo.asp" -->

<%

' *** Edit Operations: declare variables

 

Dim MM_editAction

Dim MM_abortEdit

Dim MM_editQuery

Dim MM_editCmd

 

Dim MM_editConnection

Dim MM_editTable

Dim MM_editRedirectUrl

Dim MM_editColumn

Dim MM_recordId

 

Dim MM_fieldsStr

Dim MM_columnsStr

Dim MM_fields

Dim MM_columns

Dim MM_typeArray

Dim MM_formVal

Dim MM_delim

Dim MM_altVal

Dim MM_emptyVal

Dim MM_i

 

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))

If (Request.QueryString <> "") Then

MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)

End If

 

' boolean to abort record edit

MM_abortEdit = false

 

' query string to execute

MM_editQuery = ""

%>

<%

' *** Delete Record: declare variables

 

if (CStr(Request("MM_delete")) = "form1" And CStr(Request("MM_recordId")) <> "") Then

 

MM_editConnection = MM_connViaCorpo_STRING

MM_editTable = "guestbook"

MM_editColumn = "mensagem_ID"

MM_recordId = "" + Request.Form("MM_recordId") + ""

MM_editRedirectUrl = ""

 

' 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 If

 

End If

%>

<%

' *** Delete Record: construct a sql delete statement and execute it

 

If (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <> "") Then

 

' create the sql delete statement

MM_editQuery = "delete from " & MM_editTable & " where " & MM_editColumn & " = " & MM_recordId

 

If (Not MM_abortEdit) Then

' execute the delete

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 If

 

End If

%>

<%

' *** Restrict Access To Page: Grant or deny access to this page

MM_authorizedUsers=""

MM_authFailedURL="index.asp"

MM_grantAccess=false

If Session("MM_Username") <> "" Then

If (true Or CStr(Session("MM_UserAuthorization"))="") Or _

(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then

MM_grantAccess = true

End If

End If

If Not MM_grantAccess Then

MM_qsChar = "?"

If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"

MM_referrer = Request.ServerVariables("URL")

if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()

MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)

Response.Redirect(MM_authFailedURL)

End If

%>

<%

Dim Recordset1

Dim Recordset1_numRows

 

Set Recordset1 = Server.CreateObject("ADODB.Recordset")

Recordset1.ActiveConnection = MM_connViaCorpo_STRING

Recordset1.Source = "SELECT * FROM guestbook"

Recordset1.CursorType = 0

Recordset1.CursorLocation = 2

Recordset1.LockType = 1

Recordset1.Open()

 

Recordset1_numRows = 0

%>

<%

' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

 

Dim Recordset1_total

Dim Recordset1_first

Dim Recordset1_last

 

' set the record count

Recordset1_total = Recordset1.RecordCount

 

' set the number of rows displayed on this page

If (Recordset1_numRows < 0) Then

Recordset1_numRows = Recordset1_total

Elseif (Recordset1_numRows = 0) Then

Recordset1_numRows = 1

End If

 

' set the first and last displayed record

Recordset1_first = 1

Recordset1_last = Recordset1_first + Recordset1_numRows - 1

 

' if we have the correct record count, check the other stats

If (Recordset1_total <> -1) Then

If (Recordset1_first > Recordset1_total) Then

Recordset1_first = Recordset1_total

End If

If (Recordset1_last > Recordset1_total) Then

Recordset1_last = Recordset1_total

End If

If (Recordset1_numRows > Recordset1_total) Then

Recordset1_numRows = Recordset1_total

End If

End If

%>

<%

Dim MM_paramName

%>

<%

' *** Move To Record and Go To Record: declare variables

 

Dim MM_rs

Dim MM_rsCount

Dim MM_size

Dim MM_uniqueCol

Dim MM_offset

Dim MM_atTotal

Dim MM_paramIsDefined

 

Dim MM_param

Dim MM_index

 

Set MM_rs = Recordset1

MM_rsCount = Recordset1_total

MM_size = Recordset1_numRows

MM_uniqueCol = "mensagem_ID"

MM_paramName = "id"

MM_offset = 0

MM_atTotal = false

MM_paramIsDefined = false

If (MM_paramName <> "") Then

MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")

End If

%>

<%

' *** Move To Specific Record: handle detail parameter

 

If (MM_paramIsDefined And MM_rsCount <> 0) Then

 

' get the value of the parameter

MM_param = Request.QueryString(MM_paramName)

 

' find the record with the unique column value equal to the parameter value

MM_offset = 0

Do While (Not MM_rs.EOF)

If (CStr(MM_rs.Fields.Item(MM_uniqueCol).Value) = MM_param) Then

Exit Do

End If

MM_offset = MM_offset + 1

MM_rs.MoveNext

Loop

 

' if not found, set the number of records and reset the cursor

If (MM_rs.EOF) Then

If (MM_rsCount < 0) Then

MM_rsCount = MM_offset

End If

If (MM_size < 0 Or MM_size > MM_offset) Then

MM_size = MM_offset

End If

MM_offset = 0

 

' reset the cursor to the beginning

If (MM_rs.CursorType > 0) Then

MM_rs.MoveFirst

Else

MM_rs.Close

MM_rs.Open

End If

End If

 

End If

%>

<%

' *** Move To Record: if we dont know the record count, check the display range

 

If (MM_rsCount = -1) Then

 

' walk to the end of the display range for this page

MM_index = MM_offset

While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size))

MM_rs.MoveNext

MM_index = MM_index + 1

Wend

 

' if we walked off the end of the recordset, set MM_rsCount and MM_size

If (MM_rs.EOF) Then

MM_rsCount = MM_index

If (MM_size < 0 Or MM_size > MM_rsCount) Then

MM_size = MM_rsCount

End If

End If

 

' if we walked off the end, set the offset based on page size

If (MM_rs.EOF And Not MM_paramIsDefined) Then

If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then

If ((MM_rsCount Mod MM_size) > 0) Then

MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)

Else

MM_offset = MM_rsCount - MM_size

End If

End If

End If

 

' reset the cursor to the beginning

If (MM_rs.CursorType > 0) Then

MM_rs.MoveFirst

Else

MM_rs.Requery

End If

 

' move the cursor to the selected record

MM_index = 0

While (Not MM_rs.EOF And MM_index < MM_offset)

MM_rs.MoveNext

MM_index = MM_index + 1

Wend

End If

%>

<%

' *** Move To Record: update recordset stats

 

' set the first and last displayed record

Recordset1_first = MM_offset + 1

Recordset1_last = MM_offset + MM_size

 

If (MM_rsCount <> -1) Then

If (Recordset1_first > MM_rsCount) Then

Recordset1_first = MM_rsCount

End If

If (Recordset1_last > MM_rsCount) Then

Recordset1_last = MM_rsCount

End If

End If

 

' set the boolean used by hide region to check if we are on the last record

MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Documento sem título</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">

<!--

body {

background-color: #FFFFFF;

}

.corpo {

font-family: Arial, Helvetica, sans-serif;

font-size: 10px;

color: #72716D;

line-height: 20px;

}

.box {

font-family: Arial, Helvetica, sans-serif;

font-size: 10px;

color: #72716D;

border: 1px solid #CCD8D4;

}

.corpo2 {

font-family: Arial, Helvetica, sans-serif;

font-size: 11px;

color: #72716D;

line-height: 25px;

}

.box { font-family: Arial, Helvetica, sans-serif;

font-size: 10px;

color: #72716D;

border: 1px solid #CCD8D4;

width: 150px;

}

.bot { font-family: Arial, Helvetica, sans-serif;

font-size: 9px;

color: #FFFFFF;

background-color: #ACB9A7;

width: 50px;

border: 1px solid #CCD8D4;

}

.box1 {font-family: Arial, Helvetica, sans-serif;

font-size: 10px;

color: #72716D;

border: 1px solid #CCD8D4;

width: 150px;

}

.style10 {

font-size: 24px;

font-weight: bold;

color: #72716D;

}

.style11 {color: #72716D}

-->

</style>

<script type="text/JavaScript">

<!--

function MM_preloadImages() { //v3.0

var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}

}

 

function MM_findObj(n, d) { //v4.01

var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);

if(!x && d.getElementById) x=d.getElementById(n); return x;

}

 

function MM_nbGroup(event, grpName) { //v6.0

var i,img,nbArr,args=MM_nbGroup.arguments;

if (event == "init" && args.length > 2) {

if ((img = MM_findObj(args[2])) != null && !img.MM_init) {

img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;

if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();

nbArr[nbArr.length] = img;

for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args)) != null) {

if (!img.MM_up) img.MM_up = img.src;

img.src = img.MM_dn = args[i+1];

nbArr[nbArr.length] = img;

} }

} else if (event == "over") {

document.MM_nbOver = nbArr = new Array();

for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args)) != null) {

if (!img.MM_up) img.MM_up = img.src;

img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);

nbArr[nbArr.length] = img;

}

} else if (event == "out" ) {

for (i=0; i < document.MM_nbOver.length; i++) {

img = document.MM_nbOver; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }

} else if (event == "down") {

nbArr = document[grpName];

if (nbArr)

for (i=0; i < nbArr.length; i++) { img=nbArr; img.src = img.MM_up; img.MM_dn = 0; }

document[grpName] = nbArr = new Array();

for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args)) != null) {

if (!img.MM_up) img.MM_up = img.src;

img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;

nbArr[nbArr.length] = img;

} }

}

//-->

</script>

</head>

 

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../n_images/bot_homeDicas-over.jpg','../n_images/bot_princEstudio-over.jpg','../n_images/bot_princPilatos-over.jpg','../n_images/bot_princRPG-over.jpg','../n_images/bot_princNovidades-over.jpg','../n_images/bot_princFAQ-over.jpg')">

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">

<tr>

<td align="center"><table border="0" cellpadding="0" cellspacing="0" width="980">

<!-- fwtable fwsrc="admin.png" fwbase="admin.jpg" fwstyle="Dreamweaver" fwdocid = "215666287" fwnested="0" -->

<tr>

<td><img src="../n_images/spacer.gif" width="41" height="1" border="0" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="242" height="1" border="0" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="99" height="1" border="0" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="120" height="1" border="0" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="119" height="1" border="0" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="120" height="1" border="0" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="120" height="1" border="0" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="119" height="1" border="0" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="1" height="1" border="0" alt="" /></td>

</tr>

<tr>

<td rowspan="3" colspan="2"><a href="../index.html"><img name="topo_princ" src="../n_images/topo_princ.jpg" width="283" height="105" border="0" id="topo_princ" alt="" /></a></td>

<td colspan="3"><img name="topo_princ2" src="../n_images/topo_princ2.jpg" width="338" height="42" border="0" id="topo_princ2" alt="" /></td>

<td colspan="3"><img name="topo_princi3" src="../n_images/topo_princi3.jpg" width="359" height="42" border="0" id="topo_princi3" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="1" height="42" border="0" alt="" /></td>

</tr>

<tr>

<td rowspan="2"><img name="princ_img1" src="../n_images/princ_img1.jpg" width="99" height="63" border="0" id="princ_img1" alt="" /></td>

<td><a href="../n_pages/estudio1.html" target="_top" onClick="MM_nbGroup('down','group1','bot_princEstudio','',1)" onMouseOver="MM_nbGroup('over','bot_princEstudio','../n_images/bot_princEstudio-over.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img name="bot_princEstudio" src="../n_images/bot_princEstudio.jpg" width="120" height="35" border="0" id="bot_princEstudio" alt="" /></a></td>

<td><a href="../n_pages/pilates1.html" target="_top" onClick="MM_nbGroup('down','group1','bot_princPilatos','',1)" onMouseOver="MM_nbGroup('over','bot_princPilatos','../n_images/bot_princPilatos-over.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img name="bot_princPilatos" src="../n_images/bot_princPilatos.jpg" width="119" height="35" border="0" id="bot_princPilatos" alt="" /></a></td>

<td><a href="../n_pages/rpg1.html" target="_top" onClick="MM_nbGroup('down','group1','bot_princRPG','',1)" onMouseOver="MM_nbGroup('over','bot_princRPG','../n_images/bot_princRPG-over.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img name="bot_princRPG" src="../n_images/bot_princRPG.jpg" width="120" height="35" border="0" id="bot_princRPG" alt="" /></a></td>

<td><a href="../n_pages/novid1.html" target="_top" onClick="MM_nbGroup('down','group1','bot_princNovidades','',1)" onMouseOver="MM_nbGroup('over','bot_princNovidades','../n_images/bot_princNovidades-over.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img name="bot_princNovidades" src="../n_images/bot_princNovidades.jpg" width="120" height="35" border="0" id="bot_princNovidades" alt="" /></a></td>

<td><a href="../n_pages/faq1.html" target="_top" onClick="MM_nbGroup('down','group1','bot_princFAQ','',1)" onMouseOver="MM_nbGroup('over','bot_princFAQ','../n_images/bot_princFAQ-over.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img name="bot_princFAQ" src="../n_images/bot_princFAQ.jpg" width="119" height="35" border="0" id="bot_princFAQ" alt="" /></a></td>

<td><img src="../n_images/spacer.gif" width="1" height="35" border="0" alt="" /></td>

</tr>

<tr>

<td colspan="2"><img name="princ_img2" src="../n_images/princ_img2.jpg" width="239" height="28" border="0" id="princ_img2" alt="" /></td>

<td colspan="3"><img name="princ_img3" src="../n_images/princ_img3.jpg" width="359" height="28" border="0" id="princ_img3" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="1" height="28" border="0" alt="" /></td>

</tr>

<tr>

<td><img name="admin_img1" src="../n_images/admin_img1.jpg" width="41" height="210" border="0" id="admin_img1" alt="" /></td>

<td colspan="7" rowspan="3" align="center" background="../n_images/admin_imgmeio.jpg"><table width="55%" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="54" valign="top"><div align="center" class="style10"><font face="Arial, Helvetica, sans-serif">Excluir

Notícia </font></div></td>

</tr>

<tr>

<td height="205"><form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1">

<table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">

<tr>

<td width="33%" valign="middle" height="30"><div align="right" class="txt1 style11"><font size="2" face="Arial, Helvetica, sans-serif">Título</font>:</div></td>

<td width="3%" height="30"> </td>

<td width="64%" valign="middle" height="30"><input value="<%=((Recordset1.Fields.Item("titulo").Value))%>" name="titulo" type="text" id="titulo" size="60"> </td>

</tr>

<tr>

<td valign="middle" height="30"><div align="right" class="style11"><font size="2" face="Arial, Helvetica, sans-serif">Data:</font></div></td>

<td height="30"> </td>

<td valign="middle" height="30"><span class="style11">

<input value="<%=((Recordset1.Fields.Item("data").Value))%>" name="data" type="text" id="data" size="12" maxlength="12">

<font size="1" face="Arial, Helvetica, sans-serif">dd/mm/aaaa</font> </span></td>

</tr>

<tr>

<td valign="middle" height="30"><div align="right" class="style11"><font size="2" face="Arial, Helvetica, sans-serif">Hora:</font></div></td>

<td height="30"> </td>

<td valign="middle" height="30"><input value="<%=((Recordset1.Fields.Item("hora").Value))%>" name="hora" type="text" id="hora" size="08" maxlength="05">

<span class="style11"><font size="1" face="Arial, Helvetica, sans-serif">hh:mm</font></span> </td>

</tr>

<tr>

<td valign="middle" height="30"><div align="right" class="style11"><font size="2" face="Arial, Helvetica, sans-serif">Mensagem:</font></div></td>

<td height="30"> </td>

<td valign="middle" height="30"><textarea name="mensagem" cols="60" rows="3" id="mensagem"><%=((Recordset1.Fields.Item("mensagem").Value))%></textarea></td>

</tr>

 

<tr>

<td colspan="3" valign="middle" height="30"><div align="center">

<input name="excluir" type="submit" class="botoes" id="excluir" value="Excluir Dados">

</div></td>

</tr>

</table>

 

<input type="hidden" name="MM_recordId">

<input type="hidden" name="MM_delete" value="form1">

<input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("mensagem_ID").Value %>">

</form>

<span class="txt1"> </span></td>

</tr>

</table></td>

<td><img src="../n_images/spacer.gif" width="1" height="210" border="0" alt="" /></td>

</tr>

<tr>

<td background="../n_images/fund_botRpg.jpg"> </td>

<td><img src="../n_images/spacer.gif" width="1" height="97" border="0" alt="" /></td>

</tr>

<tr>

<td background="../n_images/fund_botRpg.jpg"> </td>

<td><img src="../n_images/spacer.gif" width="1" height="104" border="0" alt="" /></td>

</tr>

<tr>

<td colspan="8"><img name="base_princ" src="../n_images/base_princ.jpg" width="980" height="34" border="0" id="base_princ" alt="" /></td>

<td><img src="../n_images/spacer.gif" width="1" height="34" border="0" alt="" /></td>

</tr>

</table></td>

</tr>

</table>

</body>

</html>

<%

Recordset1.Close()

Set Recordset1 = Nothing

%>

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.