Ir para conteúdo

POWERED BY:

Arquivado

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

Elisângela Xavier P.S.

upload.asp - error '80040e14'

Recommended Posts

Arquivo upload.asp

Alguém pode me ajudar?????


<HTML>

<BODY>

<%

Response.Charset="ISO-8859-1"

'On Error Resume Next

If Request.Form("sbmtMultiply")<>"" then 'Se Multiplicar for clicado

Value=Cint(Request.Form("txtA"))*Cint(Request.Form("txtB"))

End If


If Request.Form("sbmtDivide")<>"" then 'Se Dividir for clicado

Value=Cint(Request.Form("txtA"))/Cint(Request.Form("txtB"))

End If


If Err.number<>0 then

If Err.number=11 then '11 é o número que ocorre para a divisão por zero.

Response.Write "Esta é uma mensagem personalizada. Não é possível dividir por zero."

Response.Write "Digite um valor diferente na segunda caixa de texto!<p>"

else

Response.Write "Erro na página!<BR>"

Response.Write "O número do erro é: " & Err.number & "<BR>"

Response.Write "A descrição fornecida é: " & Err.Description & "<BR>"

End If

End If


Dim strConexao, Database


Set Database = createobject("adodb.connection")


Database.Open = "Driver=MySQL ODBC 5.1 Driver; DATABASE=eteitanhaem; SERVER=mysql01.eteitanhaem.hospedagemdesites.ws; UID=eteitanhaem; PASSWORD= "


Function NomeComponente(id_componente)

SQL = "SELECT nome FROM tb_componentes WHERE id_componente = " & id_componente

ERRO NESSA LINHA

set rs = Database.execute(SQL)


nome = rs("nome")

rs.close

set rs = nothing

NomeComponente = nome

end function


Function AlteraNome(nome)

nome = lcase(replace(nome," ","_"))

AlteraNome = nome

end function


Function NomePasta(id_curso)


if id_curso = 1 then


nome = "Ensino_Medio"


else if id_curso = 2 then


nome = "Informatica"


else if id_curso = 3 then


nome = "Saneamento"


else if id_curso = 4 then


nome = "Hidrologia"


else if id_curso = 6 then


nome = "Secretariado"


else if id_curso = 7 then


nome ="Administracao"


else if id_curso = 8 then


nome = "Logistica"


else if id_curso = 9 then


nome = "Contabilidade"


else if id_curso = 10 then


nome = "Modelagem"


else if id_curso = 11 then


nome = "InformaticaIntegrado"

else if id_curso = 12 then


nome = "AdmIntegrado"

else

nome = "Meio_Ambiente"


end if end if end if end if end if end if end if end if end if end if end if

NomePasta = nome


end function

%>

<table width="100%" border="0">

<tr>

<td style="text-align:left;"><br /><h3>Enviar Plano: <%=Ucase(NomeComponente(componente))%></h3></td>

</tr>

<tr align="left" valign="top">

<td height="187" class="style14"><table width="100%" border="0">

<tr>

<td width="100%" height="128" align="LEFT" valign="top">

<br>

<form action="?upload=sim" method="post" enctype="multipart/form-data" name="upload" onSubmit="startupload()">

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

<tr>

<td class="col2" colspan="2" height="31" style="text-align:left; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;">

<font class="letras">  <b>Localize o arquivo em seu computador:</b></font>

<input type="hidden" name="" value="" ID="Hidden1"></td>

<tr>

<td class="a1" height="26" colspan="2" bgcolor="#F4F4FF">

<input type="FILE" name="arquivo" value="" size="90" id="load" style="border:0;" /></td>

</tr>

<tr>

<td class="col1" width="490" height="43" colspan="2" bgcolor="#F4F4FF"><font class="Texto5"><br>

<input type="submit" value="Enviar Arquivo" name="btn_enviar" ID="Submit1" onClick="javascript:loading();" >

<INPUT type="hidden" id=text1 name="SaveAs" value="" tabIndex=0 readOnly size=14>

</font>

</td>

</tr>

</table>


</FORM></td>

</tr>

</table></td>

</tr>

</table>

<%

'Declara as variaveis a serem utilizadas no script

Dim SaFileUp, caminho, nomeArquivo, upload


If Request.QueryString("upload") = "sim" Then


'Determina o tempo máximo de execução do script em segundos

Server.ScriptTimeOut = 90


'Define o caminho onde o arquivo sera salvo. Exemplo: "e:\home\loginFtp\web\caminhoDaSuaAplicacao"

caminho = Server.MapPath("e:\home\eteitanhaem\web\gestao\Planos" & NomePasta(request.cookies("id_curso")) & "/" & request.cookies("id_modulo"))

' Instancia o objeto na memória

Set SaFileUp = Server.CreateObject("SoftArtisans.FileUp")


'Define onde o arquivo será salvo

SaFileUp.Path = caminho


'Salva o arquivo carregado no caminho indicado anteriormente

SaFileUp.Form("arquivo").Save


'SaFileUp = AlteraNome(NomeComponente(request.cookies("componente"))) & ".doc"

'data_entrega = datepart("yyyy",date()) & "-" & datepart("m",date()) & "-" & datepart("d",date()) & " " & FormatDateTime(time(),4)

'SaFileUp.SaveAs "e:\home\eteitanhaem\web\gestao\Planos\" & NomePasta(request.cookies("id_curso")) & "\" & request.cookies("id_modulo") & "\" & SaFileUp

%>

<h2><font color="#FF0000" size="+1" face="Trebuchet MS, Arial, Helvetica, sans-serif" class="título" id="novo" style="carrega">Arquivo Carregado com sucesso !</font></h2>

<!-- Cria uma tabela e apresenta os dados do arquivo carregado na tela -->

<table border='1'>

<th>Arquivo</th>

<th>Tamanho/Kbytes</th>

<th>ContentType</th>

<tr>

<td><a href='./upload/<%=SaFileUp.Form("arquivo").ShortFileName%>' target='_blank'><%=SaFileUp.Form("arquivo").ShortFileName%></a></td>

<td><%=SaFileUp.Form("arquivo").TotalBytes%></td>

<td><%=SaFileUp.Form("arquivo").ContentType%></td>

</tr>


</table>

<%

'SQL = "UPDATE tb_componentes SET entregue='A',id_professor=" & request.cookies("id_usuario") & ",ultima_atualizacao='" & data_entrega & "' WHERE id_componente=" & request.cookies("componente") & ";"


'Database.execute SQL


'SQL = "INSERT INTO tb_registro (status,id_componente,id_professor,data_evento)VALUES ('A'," & request.cookies("componente") & "," & request.cookies("id_usuario") & ",'" & data_entrega & "');"


'Database.execute SQL

'Database.close

'Set Database = nothing

%>


<% 'Remove a instancia do componente da memória

Set SaFileUp = Nothing



%>

</center>

<%End If%>

<%response.write "<meta http-equiv='refresh' content='1; url=principal.asp'/>"%>

</BODY>

</HTML>

Compartilhar este post


Link para o post
Compartilhar em outros sites

 

Arquivo upload.asp
Alguém pode me ajudar?????
<HTML>
<BODY>
<%
Response.Charset="ISO-8859-1"
'On Error Resume Next
If Request.Form("sbmtMultiply")<>"" then 'Se Multiplicar for clicado
Value=Cint(Request.Form("txtA"))*Cint(Request.Form("txtB"))
End If
If Request.Form("sbmtDivide")<>"" then 'Se Dividir for clicado
Value=Cint(Request.Form("txtA"))/Cint(Request.Form("txtB"))
End If
If Err.number<>0 then
If Err.number=11 then '11 é o número que ocorre para a divisão por zero.
Response.Write "Esta é uma mensagem personalizada. Não é possível dividir por zero."
Response.Write "Digite um valor diferente na segunda caixa de texto!<p>"
else
Response.Write "Erro na página!<BR>"
Response.Write "O número do erro é: " & Err.number & "<BR>"
Response.Write "A descrição fornecida é: " & Err.Description & "<BR>"
End If
End If
Dim strConexao, Database
Set Database = createobject("adodb.connection")
Database.Open = "Driver=MySQL ODBC 5.1 Driver; DATABASE=eteitanhaem; SERVER=mysql01.eteitanhaem.hospedagemdesites.ws; UID=eteitanhaem; PASSWORD= "
Function NomeComponente(id_componente)
SQL = "SELECT nome FROM tb_componentes WHERE id_componente = " & id_componente
ERRO NESSA LINHA
set rs = Database.execute(SQL)
nome = rs("nome")
rs.close
set rs = nothing
NomeComponente = nome
end function
Function AlteraNome(nome)
nome = lcase(replace(nome," ","_"))
AlteraNome = nome
end function
Function NomePasta(id_curso)
if id_curso = 1 then
nome = "Ensino_Medio"
else if id_curso = 2 then
nome = "Informatica"
else if id_curso = 3 then
nome = "Saneamento"
else if id_curso = 4 then
nome = "Hidrologia"
else if id_curso = 6 then
nome = "Secretariado"
else if id_curso = 7 then
nome ="Administracao"
else if id_curso = 8 then
nome = "Logistica"
else if id_curso = 9 then
nome = "Contabilidade"
else if id_curso = 10 then
nome = "Modelagem"
else if id_curso = 11 then
nome = "InformaticaIntegrado"
else if id_curso = 12 then
nome = "AdmIntegrado"
else
nome = "Meio_Ambiente"
end if end if end if end if end if end if end if end if end if end if end if
NomePasta = nome
end function
%>
<table width="100%" border="0">
<tr>
<td style="text-align:left;"><br /><h3>Enviar Plano: <%=Ucase(NomeComponente(componente))%></h3></td>
</tr>
<tr align="left" valign="top">
<td height="187" class="style14"><table width="100%" border="0">
<tr>
<td width="100%" height="128" align="LEFT" valign="top">
<br>
<form action="?upload=sim" method="post" enctype="multipart/form-data" name="upload" onSubmit="startupload()">
<table class="tabelas" border="0" cellpadding="0" cellspacing="0" width="100%" height="105">
<tr>
<td class="col2" colspan="2" height="31" style="text-align:left; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;">
<font class="letras">  <b>Localize o arquivo em seu computador:</b></font>
<input type="hidden" name="" value="" ID="Hidden1"></td>
<tr>
<td class="a1" height="26" colspan="2" bgcolor="#F4F4FF">
<input type="FILE" name="arquivo" value="" size="90" id="load" style="border:0;" /></td>
</tr>
<tr>
<td class="col1" width="490" height="43" colspan="2" bgcolor="#F4F4FF"><font class="Texto5"><br>
<input type="submit" value="Enviar Arquivo" name="btn_enviar" ID="Submit1" onClick="javascript:loading();" >
<INPUT type="hidden" id=text1 name="SaveAs" value="" tabIndex=0 readOnly size=14>
</font>
</td>
</tr>
</table>
</FORM></td>
</tr>
</table></td>
</tr>
</table>
<%
'Declara as variaveis a serem utilizadas no script
Dim SaFileUp, caminho, nomeArquivo, upload
If Request.QueryString("upload") = "sim" Then
'Determina o tempo máximo de execução do script em segundos
Server.ScriptTimeOut = 90
'Define o caminho onde o arquivo sera salvo. Exemplo: "e:\home\loginFtp\web\caminhoDaSuaAplicacao"
caminho = Server.MapPath("e:\home\eteitanhaem\web\gestao\Planos" & NomePasta(request.cookies("id_curso")) & "/" & request.cookies("id_modulo"))
' Instancia o objeto na memória
Set SaFileUp = Server.CreateObject("SoftArtisans.FileUp")
'Define onde o arquivo será salvo
SaFileUp.Path = caminho
'Salva o arquivo carregado no caminho indicado anteriormente
SaFileUp.Form("arquivo").Save
'SaFileUp = AlteraNome(NomeComponente(request.cookies("componente"))) & ".doc"
'data_entrega = datepart("yyyy",date()) & "-" & datepart("m",date()) & "-" & datepart("d",date()) & " " & FormatDateTime(time(),4)
'SaFileUp.SaveAs "e:\home\eteitanhaem\web\gestao\Planos\" & NomePasta(request.cookies("id_curso")) & "\" & request.cookies("id_modulo") & "\" & SaFileUp
%>
<h2><font color="#FF0000" size="+1" face="Trebuchet MS, Arial, Helvetica, sans-serif" class="título" id="novo" style="carrega">Arquivo Carregado com sucesso !</font></h2>
<!-- Cria uma tabela e apresenta os dados do arquivo carregado na tela -->
<table border='1'>
<th>Arquivo</th>
<th>Tamanho/Kbytes</th>
<th>ContentType</th>
<tr>
<td><a href='./upload/<%=SaFileUp.Form("arquivo").ShortFileName%>' target='_blank'><%=SaFileUp.Form("arquivo").ShortFileName%></a></td>
<td><%=SaFileUp.Form("arquivo").TotalBytes%></td>
<td><%=SaFileUp.Form("arquivo").ContentType%></td>
</tr>
</table>
<%
'SQL = "UPDATE tb_componentes SET entregue='A',id_professor=" & request.cookies("id_usuario") & ",ultima_atualizacao='" & data_entrega & "' WHERE id_componente=" & request.cookies("componente") & ";"
'Database.execute SQL
'SQL = "INSERT INTO tb_registro (status,id_componente,id_professor,data_evento)VALUES ('A'," & request.cookies("componente") & "," & request.cookies("id_usuario") & ",'" & data_entrega & "');"
'Database.execute SQL
'Database.close
'Set Database = nothing
%>
<% 'Remove a instancia do componente da memória
Set SaFileUp = Nothing
%>
</center>
<%End If%>
<%response.write "<meta http-equiv='refresh' content='1; url=principal.asp'/>"%>
</BODY>
</HTML>

VOLTOU A dar o mesmo erro.......

Compartilhar este post


Link para o post
Compartilhar em outros sites

Verifique a ortografia. pode ser um nome de coluna Invalido 'sua_coluna'. A coluna a qual você se refere na Base de Dados não foi encontrada. e também veja se os tipos de dados estão corretos

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.