Ir para conteúdo

POWERED BY:

Arquivado

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

Eduardo Villa

Problemas do ASP!

Recommended Posts

Olá estou desenvolvendo uma pagina em ASP pelo DREAMWEAVER e tudo que uso relacionado a FORMULÁRIOS como login, busca e newsletter esta dando erro em uma linha no código que creio eu que seja a que comunica a página com o banco de dados...

 

E a linha esta abaixo:

 

MM_editCmd.ActiveConnection = MM_Connection_STRING

 

gostaria de saber o que pode ser!!!

 

OBS: meu banco de dados é feito em ACCESS e fiz uma conexão usando no próprio Dreamweaver a DNS=Connection

 

 

Desde já agradeço

Valew

Eduardo

Compartilhar este post


Link para o post
Compartilhar em outros sites

Use esta conexao...Ch=server.mappath("DB/Banco58977.mdb")Cnn="dbq="&Ch&";driver={microsoft access driver (*.mdb)}"set Rs=server.createobject("adodb.connection")Rs.open CnnBoa sorte!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Para ficar mais facil resolvi colocar os códigos que estou desenvolvendo e as linhas que estão dando os erros!!!

Aguardo resposta

 

 

CONNECTION.ASP

<%' FileName="Connection_odbc_conn_dsn.htm"' Type="ADO" ' DesigntimeType="ADO"' HTTP="false"' Catalog=""' Schema=""Dim MM_Connection_STRINGMM_Connection_STRING = "dsn=Connection;"%>
DEFAULT.ASP

<%@LANGUAGE="VBSCRIPT"%><!--#include file="Connections/Connection.asp" --><!--#include file="Connections/Connection.asp" --><%Dim MM_editActionMM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))If (Request.QueryString <> "") Then  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)End If' boolean to abort record editDim MM_abortEditMM_abortEdit = false%><%If (CStr(Request("MM_insert")) = "inform") Then  If (Not MM_abortEdit) Then	' execute the insert	Dim MM_editCmd	Set MM_editCmd = Server.CreateObject ("ADODB.Command")"Linha que esta dando o erro"---> MM_editCmd.ActiveConnection = MM_Connection_STRING	MM_editCmd.CommandText = "INSERT INTO Informativo (nome, email) VALUES (?, ?)" 	MM_editCmd.Prepared = true	MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 255, Request.Form("nome")) ' adVarWChar	MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 255, Request.Form("email")) ' adVarWChar	MM_editCmd.Execute	MM_editCmd.ActiveConnection.Close	' append the query string to the redirect URL	Dim MM_editRedirectUrl	MM_editRedirectUrl = "default.asp"	If (Request.QueryString <> "") Then	  If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then		MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString	  Else		MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString	  End If	End If	Response.Redirect(MM_editRedirectUrl)  End IfEnd If%><%' *** Validate request to log in to this site.MM_LoginAction = Request.ServerVariables("URL")If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)MM_valUsername = CStr(Request.Form("usuario"))If MM_valUsername <> "" Then  Dim MM_fldUserAuthorization  Dim MM_redirectLoginSuccess  Dim MM_redirectLoginFailed  Dim MM_loginSQL  Dim MM_rsUser  Dim MM_rsUser_cmd    MM_fldUserAuthorization = ""  MM_redirectLoginSuccess = "login_sucesso.asp"  MM_redirectLoginFailed = "login_erro.asp"  MM_loginSQL = "SELECT usuario, senha"  If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization  MM_loginSQL = MM_loginSQL & " FROM Usuários WHERE usuario = ? AND senha = ?"  Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")"Linha que esta dando o erro"--->  MM_rsUser_cmd.ActiveConnection = MM_Connection_STRING   MM_rsUser_cmd.CommandText = MM_loginSQL  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 25, MM_valUsername) ' adVarChar  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 6, Request.Form("senha")) ' adVarChar  MM_rsUser_cmd.Prepared = true  Set MM_rsUser = MM_rsUser_cmd.Execute  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then 	' username and password match - this is a valid user	Session("MM_Username") = MM_valUsername	If (MM_fldUserAuthorization <> "") Then	  Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)	Else	  Session("MM_UserAuthorization") = ""	End If	if CStr(Request.QueryString("accessdenied")) <> "" And false Then	  MM_redirectLoginSuccess = Request.QueryString("accessdenied")	End If	MM_rsUser.Close	Response.Redirect(MM_redirectLoginSuccess)  End If  MM_rsUser.Close  Response.Redirect(MM_redirectLoginFailed)End If%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Dudesigner</title><style type="text/css"><!--body {	background-color: #CCCCCC;}.style3 {font-family: Verdana; font-weight: bold; font-size: 12px; }.style5 {	font-family: Verdana;	font-weight: bold;	font-size: 14px;	color: #000000;}a:link {	text-decoration: none;	color: #000000;}a:visited {	text-decoration: none;	color: #000000;}a:hover {	text-decoration: underline;	color: #000000;}a:active {	text-decoration: none;	color: #000000;}.style6 {font-family: Verdana}.style32 {font-family: Verdana; font-weight: bold; font-size: 11px; color: #000000; }--></style></head><body><table width="780" border="0" align="center" cellpadding="0" cellspacing="0">  <!--DWLayoutTable-->  <tr>	<td width="785" height="192" valign="top"><div align="left">	  <p><img src="imagens/Flash e PNG/logo.png" width="778" height="200" border="0" /><br />		  </p>	  <p><img src="imagens/Flash e PNG/topo2.png" width="780" height="8" border="0" /></p>	</div></td>  </tr></table><table width="780" border="0" align="center" cellpadding="0" cellspacing="0">  <!--DWLayoutTable-->  <tr>	<td width="780" height="30" valign="top">	  <form ACTION="<%=MM_LoginAction%>" id="login" name="login" method="POST">		  <table width="400" border="0">		  <tr>			<td width="56"><div align="right"><span class="style3">Usuário:</span></div></td>			<td width="108"><input name="usuario" type="text" id="usuario" size="16" maxlength="15" /></td>			<td width="10"> </td>			<td width="50" class="style3"><div align="right">Senha:</div></td>			<td width="45"><input name="senha" type="password" id="senha" size="7" maxlength="6" /></td>			<td width="13"> </td>			<td width="60"><input name="Submit" type="submit" id="Submit" value="Entrar" /></td>			<td width="60"><label>			  <a href="cad_login.asp">Registrar</a>			</label></td>		  </tr>		</table>	</form></td>  </tr>  <tr>	<td height="32" valign="top"><!--DWLayoutEmptyCell--> </td>  </tr>  <tr>	<td height="21">Busca<form id="busca" name="busca" method="get" action="resultado.asp">	  <label>	  <input type="text" name="palavra" id="palavra" />	  </label>	<label>			<input type="submit" name="Buscar" id="Buscar" value="Buscar" />			</label>	<label></label>	</form>	</td>  </tr></table><table width="780" height="463" border="0" align="center" cellpadding="0" cellspacing="0">  <!--DWLayoutTable-->  <tr>	<td width="231" rowspan="2" valign="top"><br />	  <table width="220" height="371" border="0" cellpadding="0" cellspacing="0" background="imagens/banner_public1.gif">	  <tr>		<td width="44" height="19"> </td>		<td width="55"> </td>		<td width="111"> </td>		<td width="10"> </td>	  </tr>	  <tr>		<td height="69"> </td>		<td colspan="2"><img src="imagens/anuncie.gif" width="166" height="60" border="0" /></td>		<td> </td>	  </tr>	  <tr>		<td height="69"> </td>		<td colspan="2"><img src="imagens/anuncie.gif" width="166" height="60" border="0" /></td>		<td> </td>	  </tr>	  <tr>		<td height="69"> </td>		<td colspan="2"><img src="imagens/anuncie.gif" width="166" height="60" border="0" /></td>		<td> </td>	  </tr>	  <tr>		<td height="69"> </td>		<td colspan="2"><img src="imagens/anuncie.gif" width="166" height="60" border="0" /></td>		<td> </td>	  </tr>	  <tr>		<td height="69"> </td>		<td colspan="2"><img src="imagens/anuncie.gif" width="166" height="60" border="0" /></td>		<td> </td>	  </tr>	</table></td>	<td width="549" height="351" valign="top"><!--DWLayoutEmptyCell--> </td>  </tr>  <tr>	<td height="103" valign="top"><form ACTION="<%=MM_editAction%>" METHOD="POST" id="inform" name="inform">	  <br />	  <table width="510" height="50" border="0" align="center" cellpadding="0" cellspacing="0">		<tr>		  <td width="44"><div align="right"><img src="imagens/Flash e PNG/noticias.png" width="43" height="43" /></div></td>		  <td width="441"><span class="style5">Informativo</span></td>		</tr>	  </table>		<table width="510" border="0" align="center" cellpadding="0" cellspacing="0">		  <tr>			<td width="43" class="style3">Nome:</td>			<td width="122" class="style3"><input name="nome" type="text" id="nome" size="20" /></td>			<td width="64" class="style3"><div align="right">E-mail:</div></td>			<td width="183"><span class="style3">			  <input name="email" type="text" id="email" size="25" />			</span></td>			<td width="78" class="style3"><input name="Cadastrar" type="submit" id="Cadastrar" value="Cadastrar" /></td>		  </tr>		</table>									<input type="hidden" name="MM_insert" value="inform" />				<input type="hidden" name="MM_insert" value="inform" />	</form>	</td>  </tr></table><table width="780" border="0" align="center" cellpadding="0" cellspacing="0">  <!--DWLayoutTable-->  <tr>	<td width="780" height="22" valign="top"><span class="style32">Todos os direitos reservados © Dudesigner - 2007</span></td>  </tr></table></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

cara dois includes IGUAIS???

 

pq você ñ tenta fazer o que o @VBscript colocou cara?

 

essa conexão dele está correta!

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.