Ir para conteúdo

POWERED BY:

Arquivado

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

marcelocardoso

Que erro é este

Recommended Posts

Pessoal

 

Sabem que tipo de ERRO é este aqui?????

Microsoft OLE DB Provider for ODBC Drivers- Error '80040e10' [Microsoft][Driver ODBC para Microsoft Access] Parâmetros insuficientes. Eram esperados 1. enquetevota.asp, line 44
Está dando neste código abaixo:

<%':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'INÍCIO DO SCRIPT DA ENQUETE':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::  FUNCTION String_GetFullPath( strVirtualPath )		  String_GetFullPath = Server.MapPath( strVirtualPath )		  String_GetFullPath = Replace(String_GetFullPath,"/","\") END FUNCTION FUNCTION PollMentor_GetDatabaseConn()				 'strDSN = "Driver={Microsoft Access Driver (*.mdb)};DBQ="& Server.MapPath("enquete.mdb")Set oRet = Server.CreateObject ("ADODB.Connection")		oRet.Open strDSN					SET PollMentor_GetDatabaseConn = oRet END FUNCTION FUNCTION PollMentor_GetTitle()		  PollMentor_GetTitle = "Enquete"	 END FUNCTION FUNCTION PollMentor_TryToVote( sID, nNumber )	SET oConn = PollMentor_GetDatabaseConn()		IF sID = - 1 Then	SET oRS = oConn.Execute("select id from poll where active=true")		   sID = oRS("id").Value		oRS.Close	SET oRS= Nothing	End If		IF PollMentor_CanUserVote( oConn, sID ) = False Then	   sRet = "Você já votou nesta enquete!<br>Não é possível votar novamente."	ELSE	   strSQL = "update poll set count" & nNumber & " = count" & nNumber & " +1 where "	IF nNumber = - 1 Then			strSQL = strSQL & " active=true"		Else			strSQL = strSQL & " id=" & sID		End If				oConn.Execute strSQL		oConn.Execute "insert into votelog(poll_id, ip) values(" & sID & ",'" & Request.ServerVariables( "REMOTE_ADDR" ) & "')"				sRet = "Obrigado por participar."	End If		oConn.Close	SET oConn = Nothing		PollMentor_TryToVote=sRet END FUNCTION FUNCTION PollMentor_CanUserVote( oConn, sID ) '	 sTime = DateAdd( "d", -Request.Form("time"), now() )		strSQL = "select id from votelog where poll_id=" & sID & " AND datum < #"&sTime & "# AND ip='" & Request.ServerVariables( "REMOTE_ADDR" ) & "'"		SET oRS = oConn.Execute(strSQL)		 IF oRS.EOF Then		PollMentor_CanUserVote = True		ELSE		PollMentor_CanUserVote = False	END IF				oRS.Close	SET oRS = Nothing  END FUNCTION FUNCTION PollMentor_GetPollInfo ( ByVal nID, ByRef sTitle, ByRef sQuestion, ByRef vAnswers, ByRef vCount )		SET oConn = PollMentor_GetDatabaseConn()		strSQL = "select * from poll where " 	IF nID = - 1 Then		strSQL = strSQL & " active=true"		ELSE		strSQL = strSQL & " id=" & nID	END IF		SET oRS = oConn.Execute(strSQL)	 IF oRS.EOF Then		PollMentor_GetPollInfo = False				ELSE				sTitle = PollMentor_GetTitle()				 sQuestion = oRS("question")		FOR nCount = 1 To 8			vAnswers(nCount) = oRS("answer" & CStr(nCount))			  vCount(nCount) = oRS("count" & CStr(nCount))		NEXT		PollMentor_GetPollInfo  = True		END IF			oRS.Close	SET oRS = Nothing		oConn.Close	SET oConn = NothingEND FUNCTION':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'FIM DO CÓDIGO DA ENQUETE':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::%><%'Some before doings...'Lets get the current poll...Dim sTitleDim sQuestionDim vAnswers(8)Dim vCount(8), sIDsID = Request.QueryString("id")If sID = "" Then	sID = -1End IfDim sError'Are we trying to vote?If Request.QueryString("R1") <> "" Then	'First try to vote...	sError = PollMentor_TryToVote(sID,Request.QueryString("R1") )End If'Get active one...Dim nRetnRet = PollMentor_GetPollInfo( sID, sTitle, sQuestion, vAnswers, vCount )%><HTML><HEAD><TITLE></TITLE></HEAD><BODY><link href="includes_config-css_2.css" rel="stylesheet" type="text/css"><table width="100%" border="0" cellspacing="3" cellpadding="3">  <tr>	<td><span class="TEXTO-TITULO2-BOLD"><%=sTitle%><br>	</span></td>  </tr></table>  <TABLE width="100%" BORDER=0 align="center" CELLPADDING=2 CELLSPACING=2>	<tr>	  <td height="28" colspan="4" bgcolor="#006699"><div align="center"><span class="FonteADM1"><%=sQuestion%></span></div></td>	</tr>	<tr>	  <td> </td>	  <td> </td>	  <td> </td>	  <td> </td>	</tr><%Dim nCount, nMaxValue, nLowValue'First of all get max value and nLowValuenMaxValue = 0For nCount =1 To 8 	If vAnswers(nCount) <> "" And vCount(nCount)> nMaxValue Then		nMaxValue = vCount(nCount)	End IfNext	If nMaxValue = 0 Then		nMaxValue = 1End IfDim nMaxWidth 	nMaxWidth = 200 'This is number of pixels for maxvalueDim nThisVal, nTotal, nPercent			  nTotal = 0'1. Go through all and get totalFor nCount = 1 To 8 	If vAnswers(nCount) <> "" Then		nTotal = nTotal + vCount(nCount)	End IfNextIf nTotal = 0 Then   nTotal = 1End If'2. Go through all and get percent For nCount = 1 To 8 	If vAnswers(nCount) <> "" Then	   vPercent(nCount) = FormatNumber(vCount(nCount)/nTotal*100,1)	End IfNextFor nCount = 1 To 8  If vAnswers(nCount) <> "" Then	nThisVal = FormatNumber(vCount(nCount)/nMaxValue * nMaxWidth,0)%>	<tr>	  <td width="18%"><%=vAnswers(nCount)%></td>	  <td width="54%"><img src="site_imagens/imagem_enquete_bar.gif" width="<%=nThisVal%>" height="10"></td>	  <td width="13%"><span class="TEXTO-DICAS1">		<div align="right"><%=vPercent(nCount)%> %</div>	  </span> </td>	  <td width="15%"><div align="right"><%=vCount(nCount)%> Votos</div></td>	</tr>	<%	End IfNext%>  </TABLE><table width="100%" border="0" cellspacing="3" cellpadding="3">  <tr>	<td><div align="right">Total de Votos: <span class="TEXTO-TITULO2-BOLD"><%=nTotal%></span></div></td>  </tr>  <tr>	<td><br>	  <br>	  <div align="center"><span class="TEXTO-TITULO-10p"><%=sError%></span></div></td></tr></table></BODY></HTML>
A LINHA 44 É ESTA AQUI DO strSQL:

IF PollMentor_CanUserVote( oConn, sID ) = False Then

sRet = "Você já votou nesta enquete!<br>Não é possível votar novamente."

ELSE

strSQL = "update poll set count" & nNumber & " = count" & nNumber & " +1 where "

IF nNumber = - 1 Then

PODEM ME AJUDAR???

Compartilhar este post


Link para o post
Compartilhar em outros sites

seguinte qual banco de dados você ta usando?2 - procure transdor seu " Request.ServerVariables( "REMOTE_ADDR" )" em uma variavel(ex valor= Request.ServerVariables( "REMOTE_ADDR" ))3 - a minha linha 44 deu esta " oConn.Execute "insert into votelog(poll_id, ip) values(" & sID & ",'" & Request.ServerVariables( "REMOTE_ADDR" ) & "')""espero ter dado uma luz

Compartilhar este post


Link para o post
Compartilhar em outros sites

qual é a linha 44??verifica o nome de cada campo e cada tabela usada nesta sua query eveja se está certinho com o que voce tem no DB pois pode ser erro de digitação apenas

Compartilhar este post


Link para o post
Compartilhar em outros sites

Pessoal a linha 44 é aquela que postei:

strSQL = "update poll set count" & nNumber & " = count" & nNumber & " +1 where "

Mas o script do meu FORM é este aqui:

<script LANGUAGE=JavaScript Type='Text/JavaScript'>function EnqueteAbre(URL,name,etc) { var LARGURA = (window.screen.WIDTH-400)/2; var ALTURA = (window.screen.HEIGHT-300)/2;POPUP = window.open(URL,'','width=400,height=300,left='+LARGURA+',top='+ALTURA);POPUP.focus();}</SCRIPT><table width="189" height="219" border="0" cellpadding="0" cellspacing="0" background="site_imagens/imagem_enquete_fundo_c.jpg"> <tr> <td><form action="java script:void(0);" method="POST" name="frm" target="_parent" id="frm"><table width="92%" border="0" align="center" cellpadding="2" cellspacing="2"> <tr> <td align="left" valign="top"></td> </tr> <tr> <td><br> <br /> <b><%=sQuestion%></b><br /> <br /><% nTotal = 0 For nCount = 1 To 8 If vAnswers(nCount) <> "" Then%> <input type="radio" class="INPUT_SEM_STILO3" value="<%=nCount%>" <% If nDef = False Then %>checked<% End If %> name="R1"><%=vAnswers(nCount)%><br><% nDef = True End If Next%><br></td> </tr> <tr> <td> <div align="center"> <input name="B1" type="submit" class="INPUT_SEM_STILO3" value="VOTAR" onClick="EnqueteAbre('enquete_votacao.asp?R1=<%=nCount%>')"> <a href="java script:EnqueteAbre('enquete_estatisticas.asp')">Resultados</a></div></td> </tr> </table></form></td> </tr></table>

Pois acho que o meu javascript é que tá errado!Pois testei para submeter para uma página normal sem WINDOW e funcionou...Podem me ajudar!A arrumar este javascript.

Compartilhar este post


Link para o post
Compartilhar em outros sites

antes de executar de um response.write em strSQL para ver o que ta sendo executado

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá MARIO!

 

Fiz oque você disse e está fazendo tudo certinho, ok

Notei que o script se não for submetido para uma janela POPUP, funciona normalmente.....

 

Só não funciona quando tento mandar para uma janela popup????

Acho que é por causa do meu OnClick que tá errado, pois ele não está submetendo....alguma coisa que precisa, ok

 

PODE ME AJUDAR a mandar para uma popup????

Pois acho que não devo passar esta variavél enquete_votacao.asp?R1=<%=nCount%>

 

Acho que não é nCount, deve ser outra....mas qual eu não sei?

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.