Ir para conteúdo
Fórum Script Brasil
  • 0

Problemas Ainda Com Include


Guest - Wellington -

Pergunta

Guest - Wellington -

Ai pessoal ainda não consegui colocar os includes.

vamos lá.

criei uma página index.asp

abaixo segue o código

<body>

Teste

<!--#include file="enquete/br_enquete_conexao.inc"-->

%>

<!--#include virtual="enquete/br_enquete_conexao.inc"-->

</body>

Que chama a enquete num diretorio

enquete/default.asp

a enquete funciona mas não aparece na pagina index.asp isto é o include não está chamando dá o seguinte erro.

Active Server Pages, ASP 0126 (0x80004005)

O arquivo de inclusão 'enquete/br_enquete_conexao.inc' não foi encontrado.

/sis/teste/index.asp, line 13

Link para o comentário
Compartilhar em outros sites

21 respostass a esta questão

Posts Recomendados

  • 0

cara você está colocando o caminho errado, por isso não vai...

coloca assim:

<!--#include file="enquete/default.asp"-->

isso deve resolver...

outra coisa..não precisa postar várias vezes aqui...as vezes demora o pessoal a responder, mas sempre respondem

Link para o comentário
Compartilhar em outros sites

  • 0

Não eu vi isso e ainda não chama não sei o que esta acontecendo você viu o erro que dá? Outra coisa não colocaquei varios topicos de proposito é que quando eu fui postar dava dando erro mail não sei o que dai eu fiquei tentando só que estava postando sem eu saber me descukpe, mas é bom vocês verem isso na hora de postar a pergunta ta dando erro mail. no forum.

dá pra min ajudar com os includes??

Link para o comentário
Compartilhar em outros sites

  • 0

Eu vi isso mas não resolveu nada.

<title>Untitled</title>

</head>

<body>

Teste

<!--#include file="enquete/default.asp"-->

%>

<!--#include virtual="enquete/default.asp"-->

</body>

</html>

a enquete funciona mas não aparece na pagina index.asp isto é o include não está chamando dá o seguinte erro.

Active Server Pages, ASP 0126 (0x80004005)

O arquivo de inclusão 'enquete/br_enquete_conexao.inc' não foi encontrado.

/sis/teste/index.asp, line 13

Link para o comentário
Compartilhar em outros sites

  • 0
Guest Wellinton

é mais o arquivo .inc está la saca só

copia do aquivo br_enquete_conexao.inc

<%

'Dimension variables

Dim adoCon 'Database Connection Variable

Dim rsWeeklyPoll 'Database Recordset Variable to hold the eweekly poll recordset

Dim strAccessDB 'Holds the Access Database Name

Dim strSQL 'Database query sring

Dim strPollQuestion 'Holds the poll question

Dim intPollIDNum 'Holds the Poll ID Num

Dim intSelectionLoopCounter 'Loop counter to display the poll selections

Dim intVotedIDNo 'Holds the ID Number the last vote the user voted in if there is one

Dim blnCheckForPoll 'Set to false if there are no weekly polls in the database

Dim blnAlreadyVoted 'Set to true if the user has voted in this weeks poll

'Error Trapping

On Error Resume Next

'Intilaise variables

blnCheckForPoll = True

blnAlreadyVoted = False

intPollIDNum = 1

'Initialise the strAccessDB variable with the name of the Access Database

strAccessDB = "br_enquete_db.mdb"

'Create a connection odject to the database

Set adoCon = Server.CreateObject("ADODB.Connection")

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

'Open connection to the database driver

adoCon="DRIVER={Microsoft Access Driver (*.mdb)};"

'Open Connection to database

adoCon = adoCon & "DBQ=" & server.mappath(strAccessDB)

'Initalise the strSQL variable with an SQL statement to query the database

var_id = Request.Querystring("PollID")

if var_id <> "" then

strSQL = "SELECT * FROM tblPolls WHERE id_no="&var_id&";"

else

strSQL = "SELECT * FROM tblPolls ORDER By id_no DESC;"

end if

'Query the database

rsWeeklyPoll.Open strSQL, adoCon, 3

'Check there is a weekly poll to display

If rsWeeklyPoll.EOF Then

'If there is no weekly poll in the database chenge the blnCheckForPoll variable to false

blnCheckForPoll = False

Else

'Read in the polling question from the database

strPollQuestion = rsWeeklyPoll("Question")

'Read in the Weekly Poll ID number

intPollIDNum = CInt(rsWeeklyPoll("id_no"))

'Loop round to read in the number of votes cast

For intReadInVotesLoopCounter = 1 To 6

'Read in the total number of votes cast

intToatalPollVotes = intToatalPollVotes + CInt(rsWeeklyPoll("Votes_" & intReadInVotesLoopCounter & ""))

Next

'Check the user has not already voted by reading in a cookie from there system

'Read in the Poll ID number of the last poll the user has voted in

intVotedIDNo = CInt(Request.Cookies("Poll")("PollID"))

'If the user has already voted then redirect them to the results page

If intVotedIDNo = intPollIDNum Then blnAlreadyVoted = True

End If

%>

<script language="JavaScript">

<!-- Hide from older browsers...

//Function to open pop up window

function openWin(theURL,winName,features) {

window.open(theURL,winName,features);

}

// -->

</script>

<head>

<title>Enquete</title>

<form method="post" action="result_enquete.asp" target="poll" onSubmit="window.open('', 'poll', 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=460,height=400')">

<style>

<!--

font { font-family: Arial; font-size: 11 }

-->

</style>

</head>

<table width="149" border="0" cellspacing="0" cellpadding="1" align="center">

<tr>

<td colspan="2"><font face="Arial, Helvetica, sans-serif" size="1">

<% = strPollQuestion %>

</font></td>

</tr>

<tr>

<td>

<%

'If there is a weekly poll to display then write the HTML to display it

If blnCheckForPoll = True Then

'Loop to display each of the selection choices for the poll

For intSelectionLoopCounter = 1 To 6

'If there is a Selection choice then display the HTML to show it

If NOT rsWeeklyPoll("Selection_" & intSelectionLoopCounter) = "" Then

If blnAlreadyVoted = False Then

'Display a radio button for the selection choice

Response.Write vbCrLf & " <tr><td><input type=""radio"" name=""PollVote"" value=""Votes_" & intSelectionLoopCounter & """>"

'Display the selection choice

Response.Write vbCrLf & " <font face=""arial"" size=""1"">" & rsWeeklyPoll("Selection_" & intSelectionLoopCounter) & "</font></td></tr>"

Else

'If there are no votes yet then format the percent by 0 otherwise the sums corse problems

If intToatalPollVotes = 0 Then

dblPollVotePercentage = FormatPercent(0, 0)

Else

'Read in the the percentage of votes cast for the vote choice

dblPollVotePercentage = FormatPercent((rsWeeklyPoll("Votes_" & intSelectionLoopCounter) / intToatalPollVotes), 0)

End If

'Display the selection choice results

Response.Write vbCrLf & " <tr>"

Response.Write vbCrLf & " <td colspan=""2""><font face=""arial"" size=""1"">" & rsWeeklyPoll("Selection_" & intSelectionLoopCounter) & "</font></td>"

Response.Write vbCrLf & " </tr>"

Response.Write vbCrLf & " <tr>"

Response.Write vbCrLf & " <td width=""140""><img src=""imagens/bar_graph_image.gif"" width=""" & dblPollVotePercentage & """ height=""11""></td>"

Response.Write vbCrLf & " <td width=""9"" align=""right""><font face=""arial"" size=""1"">" & dblPollVotePercentage & "</font></td>"

Response.Write vbCrLf & " </tr>"

End If

End If

Next

%>

</td>

</tr>

<tr>

<td align="center" colspan="2">

<%

'If the user has not voted then display a vote button

If blnAlreadyVoted = False Then

%>

<input type="hidden" name="id" value="<% = intPollIDNum %>">

<input type="submit" value="Votar" name="submit" style="font-family: Arial; font-size: 11">

<%

'Display the totla number of votes

Else

'Display the total votes cast

Response.Write vbCrLf & " <font face=""arial"" size=""1"">Total de Votos: " & intToatalPollVotes & "</font>"

End If

'Else if there is no weekly poll display the appropriate message

Else

Response.Write "<center><font size=1 face=arial color=#000000>" & vbCrLf & "N&atilde;o h&aacute; enquetes dispon&iacute;veis</font></center>"

End If

'Reset Server Objects

Set adoCon = Nothing

rsWeeklyPoll.Close

Set rsWeeklyPoll = Nothing

%>

</td>

</tr>

<tr>

<td align="center" colspan="2"><a href="JavaScript:openWin('result_enquete.asp?PollID=<% = intPollIDNum %>','poll','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=460,height=400')"><font face="arial" size="1" color="#000000">Resultados</font></a></td>

</tr>

</table>

</form>

Link para o comentário
Compartilhar em outros sites

  • 0
Guest - Wellington -

Eu coloquei. Esta assim:

sis/teste/index.asp

o index.asp esta com os includes chamando enquete/default.asp

dntro da pasta enquete/default.asp

tabém está o br_enquete_conexao.inc

mas dá esse erro

Active Server Pages, ASP 0126 (0x80004005)

O arquivo de inclusão 'enquete/default.asp' não foi encontrado.

/sis/teste/index.asp, line 13

Link para o comentário
Compartilhar em outros sites

  • 0
Guest - Wellington -

estou mexendo mas até agora nada, este aqui br_enquete_conexao.inc"--> está dentro da pasta enquete. etambém coloquei uma copia na pasta

sis/teste/index.asp

onde esta o index.asp

mas também não resolveu.

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

<html>

<head>

<title>Untitled</title>

</head>

<body>

Teste

<!--#include file="enquete/br_enquete_conexao.inc"-->

%>

<!--#include virtual="enquete/br_enquete_conexao.inc"-->

</body>

</html>

Link para o comentário
Compartilhar em outros sites

  • 0
Guest - Wellington -

mesma coisa continua dando este erro

Active Server Pages, ASP 0126 (0x80004005)

O arquivo de inclusão 'enquete/br_enquete_conexao.inc' não foi encontrado.

/sis/teste/index.asp, line 12

A enquete tem um banco de dados MDB tem alguma coisa haver com isso?

Link para o comentário
Compartilhar em outros sites

  • 0

Wellinton, eu estou utilizando essa mesma enquete em um site que estou fazendo e tá tudo ok.

Porem eu fiz umas alterações no BD eu importei a tabela de dentro do BD da enquete para dentro de meu BDque utilizarei para as informaçoes.

Mais não é isso o seu problema.

Se você deixou a sua página index.asp dentro de um subdiretório e levando em consideração que sua enquete está em uma pasta chamada enquete que tb é subdiretório.

tente por isso:

<!--#include file="../enquete/br_enquete_conexao.inc"-->

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652k
×
×
  • Criar Novo...