error '80004005'
Eaw galera, tudo bom?
é o seguinte, aqui na agencia que eu trabalho tem um site muito antigo em ASP
só programo em PHP não entendo absolutamente nada de ASP.
esse sistema funcionava direitinho na KingHost, mas o cliente resolveu mudar a hospedagem pra LocalWeb, daqui começou
a aparecer esse erro toda vez que eu vou inserir algo no banco
error '80004005'
/gerenciador/admin_noticias_insert.asp, line 162
segue o código para análise:
<%@LANGUAGE="VBSCRIPT"%>
<!-- #include file="ktml2/includes/ktedit/activex.asp"-->
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1"
If (CStr(Request("MM_Logoutnow")) = "1") Then
Session.Contents.Remove("MM_Username")
Session.Contents.Remove("MM_UserAuthorization")
MM_logoutRedirectPage = "../index.asp"
' redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage = "") Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL"))
If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_newQS = "?"
For Each Item In Request.QueryString
If (Item <> "MM_Logoutnow") Then
If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End If
Next
if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
End If
Response.Redirect(MM_logoutRedirectPage)
End If
%>
<%
dim include: include=1
dim useTemplates: useTemplates=1
dim useIntrospection: useIntrospection=1
dim KT_display
%>
<!--#include file="conn_faeal.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="bccom.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
%>
<%
' *** 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 = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert")) = "frm_noticias_insert") Then
MM_editConnection = MM_conn_faeal_STRING
MM_editTable = "tbl_noticias"
MM_editRedirectUrl = "admin_noticias_master.asp"
MM_fieldsStr = "data|value|tema|value|manchete|value|leading|value|texto|value|fonte|value|imagem|value|imagem_Alt|value|Destaque|value"
MM_columnsStr = "data|',none,NULL|tema|',none,''|manchete|',none,''|leading|',none,''|texto|',none,''|fonte|',none,''|imagem|',none,''|imagem_Alt|',none,''|destaque|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' 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
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(Request("MM_insert")) <> "") Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
If (Not MM_abortEdit) Then
' execute the insert
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
%>
<%
Dim rs_noticias
Dim rs_noticias_numRows
Set rs_noticias = Server.CreateObject("ADODB.Recordset")
rs_noticias.ActiveConnection = MM_conn_faeal_STRING
rs_noticias.Source = "SELECT * FROM tbl_noticias"
rs_noticias.CursorType = 0
rs_noticias.CursorLocation = 2
rs_noticias.LockType = 1
rs_noticias.Open()
rs_noticias_numRows = 0
%>
<html>
<head>
<title>FAEAL - Federação da Agricultura e Pecuária do Estado de Alagoas: Administração do Site</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="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[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<meta name="generator" content="Namo WebEditor v5.0(Trial)">
<style type="text/css"><!--
body {
background-color: #C1C3CC;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-image: url();
}-->
</style>
<link href="../css/sistema.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#4497E7"><div align="center">
<table width="700" height="100" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/sistema.jpg">
<tr>
<td width="749" height="100"> </td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td><div align="center">
<table width="700" border="0" cellpadding="3" cellspacing="0" bgcolor="#D2D3DB">
<tr>
<td width="969"><p align="right" class="texto">[ <a href="admin_index.asp" class="leia_mais">Administração do Site</a> ] - [ <a href="javascript:history.go(-1);" class="leia_mais">Voltar</a><a href="admin_index.asp" class="leia_mais"> </a> ] - [ <a href="<%= MM_Logout %>" class="leia_mais">sair</a> ] </p>
<div align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="6">
<tr>
<td><p class="barr_titulos">Inserir conteúdo</p>
<p><span class="tema5">Atenção:</span><span class="rodape"><br>
</span><span class="rodape"><span class="tema5">*</span> Para modificar ou remover, clique em um dos links abaixo: Ao clicar em "apagar", você estará excluindo permanentemente o registro do banco de dados. <br>
<span class="tema5">*</span> A fonte padrão para os textos é: (Arial 11Px)</span></p></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td> <form ACTION="<%=MM_editAction%>" method="POST" name="frm_noticias_insert" id="frm_noticias_insert">
<table width="700" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#D2D3DB" bgcolor="#D2D3DB">
<tr>
<td align="center" valign="top"> <div align="left"><span class="tema">data:</span><span class="texto3"><br>
<input name="data" type="text" id="data2" value="<% response.Write(now)%>" size="30">
</span></div></td>
</tr>
<tr>
<td align="center" valign="top"><div align="left">
<span class="tema">Tema:</span><br>
<input name="tema" type="text" id="tema2" size="110">
</div></td>
</tr>
<tr>
<td align="center" valign="top"><div align="left">
<span class="tema">Manchete:</span><br>
<textarea name="manchete" cols="83" rows="3" wrap="virtual" id="textarea2"></textarea>
</div></td>
</tr>
<tr>
<td align="center" valign="top"><div align="left">
<span class="tema">Leading:</span><br>
<textarea name="leading" cols="83" rows="3" wrap="virtual" id="textarea3"></textarea>
</div></td>
</tr>
<tr>
<td align="center" valign="top"><div align="left">
<span class="tema">Texto:</span><br>
<input name="texto" type="hidden" id="texto">
<%
KT_display = "Cut,Copy,Paste,Insert Image,Insert Table,Toggle Vis/Invis,Toggle WYSIWYG,Bold,Italic,Underline,Align Left,Align Center,Align Right,Align Justify,Background Color,Foreground Color,Undo,Redo,Bullet List,Numbered List,Indent,Outdent,HR,Font Type,Font Size,Insert Link,SpellCheck,Clean Word,Style List,Introspection,TableEdit"
call showActivex("texto", 685, 250, false, KT_display, "../ktml2/", "css/faeal.css", "../../../images/", "../../../files/", "English (UK)", -1, "english")%>
</div></td>
</tr>
<tr>
<td align="center" valign="top"><div align="left">
<span class="tema">Fonte:</span><br>
<input name="fonte" type="text" id="fonte2" size="55">
</div></td>
</tr>
<tr>
<td align="center" valign="top"><div align="left">
<span class="tema">Imagem:</span><br>
<input name="imagem" type="text" id="imagem2" size="55">
</div></td>
</tr>
<tr>
<td align="center" valign="top"><div align="left">
<span class="tema">Legenda da foto:</span><br>
<input name="imagem_Alt" type="text" id="imagem_Alt" value="" size="110">
</div></td>
</tr>
<tr>
<td align="center" valign="middle"><div align="left">
<span class="tema">Notícia em Destaque: <br>
</span></div> <div align="left">
<table cellpadding="3" cellspacing="0">
<tr>
<td width="60"><label> <span class="texto3">
<input name="Destaque" type="radio" value="1">
Sim</span></label></td>
<td width="60" class="texto3"><input name="Destaque" type="radio" value="0">
Não</td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td align="center" valign="middle"><div align="left">
<label>
<input name="Submit" type="submit" class="leia_mais2" value="Inserir conteúdo">
</label>
<input type="hidden" name="MM_insert" value="frm_noticias_insert">
</div></td>
</tr>
</table>
</form></td></tr>
<tr>
<td bgcolor="#D9DAE1"><div align="center">
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#D9DAE1">
<tr>
<td width="986" align="left" valign="middle"><div align="right">
<table width="163" border="0" cellpadding="3" cellspacing="0">
<tr>
<td width="157" valign="middle"><span class="leia_mais">Bccom -</span> <a href="http://www.bccom.com.br" target="_blank" class="leia_mais">www.bccom.com.br</a></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div></td>
</tr>
</table>
</body>
</html><%
rs_noticias.Close()
Set rs_noticias = Nothing
%>
a principio eu pensei que fosse problema de permissão de acesso ao banco, mas ta tudo liberado
meu chefe já ta me cobrando por que tem notícias atrasadas para serem postadas no site
obrigado a todos
Discussão (1)
Carregando comentários...