Uso dois tipos de conexao com banco de dados, akele que vc só dia onde está o bando ex: (bd/bd.mdb) e tem akele super chato (C:\inetpub\....) etc...
Seguinte... axo que o server que eu uso não deixa eu user esse segundo modo... mas quando eu altero a conexao.. da pau em tudo e eu fico loko procurando erros e tals.... portanto.. me ajudem...
O Codigo original é esse
<%
Response.Expires = 0
if len(session("adm.codigo")) = 0 then Response.Redirect "../senha.asp"
%>
<html>
<head>
<title>Administracao</title>
</head>
<body>
<center><font face="Arial" size="4"><b>Formulário de Alteração</b></h2></center>
<%
If IsEmpty( Request.Form("submit") ) Then
Set Conexao = Server.CreateObject("ADODB.Connection")
Constr = "DBQ=C:\Inetpub\wwwroot\denisecastro\admin\denise\bd\info.mdb;Driver={Microsoft Access Driver (*.mdb)};"
Conexao.Open Constr
ComandoSQL = "SELECT * FROM info"
Set bd = Server.CreateObject("ADODB.Recordset")
bd.CursorLocation = 2
bd.CursorType = 0
bd.LockType = 3
bd.Open ComandoSQL, conexao,,, &H0001
If Not bd.EOF Then
bd.Move Request.QueryString("n")
%>
<form method=post action="<%=Request.ServerVariables("script_name")%>">
<input type=hidden name="ComandoSQL" value="<%=ComandoSQL%>">
<input type=hidden name="Conexao" value="<%=Constr%>">
<div align="center">
<center>
<table border=0 width="80%" cellspacing="7" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0">
<tr>
<td align=right valign=top><font size="2">Alterar texto da pagina <br>
Denise Castro:</font></td>
<td align=left valign=top>
<font face="Arial" size="2">
<textarea rows="5" name="denisecastro" cols="20" style="border-style: solid; border-width: 1"><%=bd("denisecastro")%></textarea></td>
</tr>
<tr>
<td align=right valign=top><font face="Arial" size="2">Alterar texto da
pagina <br>
Denise Castro versão Inglês:</font></td>
<td align=left valign=top>
<font face="Arial" size="2">
<textarea rows="5" name="denisecastroeng" cols="20" style="border-style: solid; border-width: 1"><%=bd("denisecastroeng")%></textarea></td>
</tr>
<tr>
<td align=right valign=top><font size="2" face="Arial">Alterar texto da
pagina <br>
Empresa</font></td>
<td align=left valign=top>
<font face="Arial" size="2">
<textarea rows="5" name="empresa" cols="20" style="border-style: solid; border-width: 1"><%=bd("empresa")%></textarea></td>
</tr>
<tr>
<td align=right valign=top><font size="2" face="Arial">Alterar texto da
pagina <br>
Empresa versão Inglês::</font></td>
<td align=left valign=top>
<font face="Arial" size="2">
<textarea rows="5" name="empresaeng" cols="20" style="border-style: solid; border-width: 1"><%=bd("empresaeng")%></textarea></td>
</tr>
</font>
</table>
</center>
</div>
<center><input type=submit name=submit value=Alterar style="{<font-family:Arial; font-size:12}"></center>
<input type="hidden" name="n" value="<%if Not IsEmpty(Request.QueryString("n"))then : Response.Write Request.QueryString("n") Else : Response.Write "0" : End If%>">
</form>
<center>
<%
If Request.QueryString("n") > 0 then
Response.Write "<a href=" & Request.ServerVariables("SCRIPT_NAME") & "?n=" & Request.QueryString("n") - 1 & "><< Anterior</a> "
End If
bd.MoveNext
If Not bd.EOF then
Response.Write " <a href=" & Request.ServerVariables("SCRIPT_NAME") & "?n=" & Request.QueryString("n") + 1 & ">Próximo >></a>"
End If
Conexao.Close
Set bd = Nothing
Set Conexao = Nothing
%>
</center>
<%
End If
Else
If Not IsEmpty(Request.Form("submit")) AND Trim(Request.Form("denisecastro")) <> "" AND Trim(Request.Form("denisecastroeng")) <> "" AND Trim(Request.Form("empresa")) <> "" AND Trim(Request.Form("empresaeng")) <> "" Then
Set Conexao = Server.CreateObject("ADODB.Connection")
Conexao.Open Request.Form("Conexao")
ComandoSQL = Request.Form("ComandoSQL")
Set bd = Server.CreateObject("ADODB.Recordset")
bd.CursorLocation = 2
bd.CursorType = 0
bd.LockType = 3
bd.Open ComandoSQL, Conexao,,, &H0001
bd.Move Request.Form("n")
bd("denisecastro") = Server.HTMLEncode(Request.Form("denisecastro"))
bd("denisecastroeng") = Server.HTMLEncode(Request.Form("denisecastroeng"))
bd("empresa") = Server.HTMLEncode(Request.Form("empresa"))
bd("empresaeng") = Server.HTMLEncode(Request.Form("empresaeng"))
bd.UpdateBatch
bd.Requery
%>
<font face="Arial" size="2">
<center><br>Os dados foram enviados com sucesso!
<%
Else
%>
<br><br>Atenção: Alguns dados necessário não foram preenchidos corretamente
<br><a href="java script:history.go(-1)"><b>Clique aqui</b></a> para voltar</font></center>
<%
End If
End If
%>
</body>
</html>
aonde está em negrito, é só ali que eu preciso alterar?
[]'s
valeu
Edição feita por: Info_Tec, 04/05/2004, 20:24.