Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Boa tarde pessoal, estou precisando de uma ajuda muito urgente :S
Estou fazendo uma migração de dominio em uma aplicação feita em ASP, só que ao mudar de dominio a classe de conexão dela está dando um erro
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/wm/relatorios/fabricante.asp, line 42
Está linha 42 é o arquivo que abre a conexão:
Arquivo fabricante.asp
<!-- #include file = "../permissoes/acesso.asp" -->
<!-- #include file = "../../conn_open.asp" -->
<!-- #include file = "../biblioteca/funcoes.asp" -->
<%
DIM it_resultado, it_desc, it_pag, vc_order, vc_formulario, st_order
it_resultado = int(request("it_resultado"))
it_desc = int(request("it_desc"))
it_pag = int(request("it_pag"))
vc_order = trim(request("vc_order"))
vc_formulario = "fabricante"
st_order = replace(split(vc_string,"vc_order=")(0) & "vc_order=new_order&it_desc=" & abs(it_desc-1) & "&it_pag=" & it_pag,"||","&")
DIM vc_termo
vc_termo = replace(request("vc_termo"),"'","´")
DIM vc_coluna, vc_inner, vc_filtro, vc_desc
vc_coluna = ""
vc_coluna = vc_coluna & " a.id_fabricante,"
vc_coluna = vc_coluna & " a.it_status,"
vc_coluna = vc_coluna & " a.vc_fabricante,"
vc_coluna = vc_coluna & " COUNT(b.id_produto) as id_produto"
vc_inner = ""
vc_inner = vc_inner & " FROM mt1_tb_fabricante AS a WITH(NOLOCK)"
vc_inner = vc_inner & " LEFT JOIN mt1_tb_produto AS b"
vc_inner = vc_inner & " on a.id_fabricante = b.id_fabricante"
vc_filtro = ""
vc_filtro = vc_filtro & " WHERE a.id_fabricante > 0"
if len(vc_termo) > 0 then
vc_filtro = vc_filtro & " AND a.vc_fabricante LIKE '%" & vc_termo & "%'"
end if
vc_group = "GROUP BY a.id_fabricante, a.it_status, a.vc_fabricante"
if len(vc_order) > 0 then
vc_order = " ORDER BY " & vc_order
if it_desc > 0 then vc_desc = " DESC"
end if
RS.CursorLocation = 3
RS.Open "SELECT" & vc_coluna & vc_inner & vc_filtro & vc_group & vc_order & vc_desc, DB_RS, , , 1
RS.PageSize = it_resultado
it_total = formatnumber(RS.RecordCount,0)
it_pag_total = formatnumber(RS.PageCount,0)
%><html>
<head>
<title>Web Manager</title>
<link rel="Stylesheet" href="../css/estilos.css">
<script language="Javascript" src="../jss/default.js"></script>
</head>
<body class="bg_02" onLoad="javascript:local(2,' » <%=vc_formulario%> » <%=it_total%> registro<%if it_total <> 1 then%>s<%end if%> nesta pesquisa');javascript:paginar(<%=it_pag_total%>,'<%=vc_codigo%>','<%=vc_string%>');">
<table cellpadding="3" cellspacing="1" width="100%"><%<tr>
<td style="padding:0"><a class="lk_02" href="javascript:ordenar('<%=vc_codigo%>','<%=replace(st_order,"new_order","a.id_fabricante")%>')">id</a></td>
<td style="padding:0"><a class="lk_02" href="javascript:ordenar('<%=vc_codigo%>','<%=replace(st_order,"new_order","a.vc_fabricante")%>')">fabricante</a></td>
<td style="padding:0"><a class="lk_02" href="javascript:ordenar('<%=vc_codigo%>','<%=replace(st_order,"new_order","a.id_status")%>')">status</a></td>
<td style="padding:0" width="46" align="center"><a class="lk_02">ações</a></td>
</tr><%x = int(x+1)
id = int(RS("id_fabricante"))
SELECT CASE int(RS("it_status"))
CASE 0 vc_status = "<font class=""cr_01""><b>inativo</b></font>"
CASE 1 vc_status = "<font class=""cr_03""><b>ativo</b></font>"
END SELECT
%>
<tr<%if (x mod 2) > 0 then%> class="tr_03"<%end if%>>
<td align="right"><font class="cr_01"><b><%=id%></b></font></td>
<td><%=replace(RS("vc_fabricante"),"´","'")%></td>
<td><%=vc_status%></td>
<td align="center"><a href="javascript:alterar('<%=vc_codigo%>',<%=id%>)" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('alterar<%=x%>','','../imagens/bt_02_on.gif',1)"><img src="../imagens/bt_02_off.gif" name="alterar<%=x%>" width="20" height="20" border="0"></a><%if RS("id_produto") = 0 then%><a href="javascript:excluir('<%=vc_codigo%>',<%=id%>)" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('excluir<%=x%>','','../imagens/bt_03_on.gif',1)"><img src="../imagens/bt_03_off.gif" name="excluir<%=x%>" width="20" height="20" border="0"></a><%end if%></td>
</tr><%RS.MoveNext
loop
else
%>
<tr>
<td><font class="cr_01"><b>Não existem dados referentes a esta pesquisa.</b></font></td>
</tr><%</table>
</body>
</html>Arquivo de Que abre a conexão:
<%
response.addheader "pragma", "no-cache"
response.cachecontrol = "no-cache"
response.expires = -1
session.LCID = 1046
session.timeout = 360
server.scripttimeout = 3600
vc_codigo = split(split(request.ServerVariables("SCRIPT_NAME"),"/")(ubound(split(request.ServerVariables("SCRIPT_NAME"),"/"))),".")(0)
vc_string = replace(request.ServerVariables("QUERY_STRING"),"&","||")
vc_diretorio = trim(request.ServerVariables("APPL_PHYSICAL_PATH"))
vc_servidor = trim(request.ServerVariables("SERVER_NAME"))
vc_ip = trim(request.ServerVariables("REMOTE_ADDR"))
'#I diretório dos sites do grupo
vc_diretorio_meggatech = vc_diretorio & "meggatech\"
vc_diretorio_meggaplastico = vc_diretorio & "meggaplastico\"
vc_diretorio_meggaton = vc_diretorio
'vc_diretorio_meggaton = vc_diretorio & "meggaton\"
vc_diretorio_meggalog = vc_diretorio & "\meggalog\"
vc_diretorio_meggalog = vc_diretorio_meggaton
'#F diretório dos sites do grupo
'# começa a contar os meses a partir do índice 1
ar_mes = Array("", "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro")
'pois o site da meggatech só tem opção de full banner (Alexandre)
ar_banner_tipo = split("1,Full banner|2,Half banner","|")
'ar_banner_tipo = split("1,Full banner","|")
ar_banner_target = split("da_browser,Janela principal|self,Mesma janela","|")
'if vc_servidor = "xavier" then
' vc_initial_catalog = "meggatech"
' vc_user_id = "user"
' vc_password = "password"
' vc_data_source = vc_servidor
'else
vc_initial_catalog = "nomebanco"
vc_user_id = "nomebanco"
vc_password = "senhabanco"
vc_data_source = "urlSQLSERVER"
'end if
SET FSO = Server.CreateObject("Scripting.FileSystemObject")
SET DB = Server.CreateObject("ADODB.Connection")
SET RS = Server.CreateObject("ADODB.Recordset")
DB_RS = "Initial Catalog=" & vc_initial_catalog & "; User ID=" & vc_user_id & "; Password=" & vc_password & "; Data Source=" & vc_data_source & "; Provider=SQLOLEDB.1; Persist Security Info=True;"
DB.Open "Initial Catalog=" & vc_initial_catalog & "; User ID=" & vc_user_id & "; Password=" & vc_password & "; Data Source=" & vc_data_source & "; Provider=SQLOLEDB.1; Persist Security Info=True;"
%>
To precisando muito de ajuda, não manjo nada de asp, será que alguém poderia me dar uma dica para resolver este problema ?
Carregando comentários...