Ir para conteúdo

Arquivado

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

Dony

'80040e21'

Recommended Posts

Pessaol,

Estou tentando rodar o Admentor 2.21 com MySql e na hora de criar ou atualizar dados esse retorna esse erro:

 

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

 

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

 

/admentor/admin/adminaccount.asp, line 76 ´

 

Já li e reli o codigo inteiro e não encontrei o erro, abaixo o codigo

 

<!--#include file="../include/admentorsecurity.asp"--><!--#include file="../include/admentor2.asp"--><!--#include file="menu.inc"--><html><%'''''''''''  (C) Stefan Holmberg 1999  '''''''''''  Free to use if these sourcecode lines is not deleted '''''''''''  Contact me at webmaster@sqlexperts.com'''''''''''  http://www.sqlexperts.com'''''''''''  AdMentor homepage at http://www.create-a-webshop.com'''GlobalsDim sUID, sEmailAddress, sFullName, sError, fAdmin, nAdvIdCall Main()'Tries to save ( update/addnew ). Returns error stringFunction TrySave( oConn )	'	' Now 	Dim oRS	   sUID = Request.Form("loginname")   If sUID = "" Then   		sUID = Session("loginname")   End If         	Set oRS = Server.CreateObject("ADODB.Recordset")   	Set oRS.ActiveConnection = oConn	'Try to open it...	nAdvId = Request.QueryString("id")	If Session("admin") = 1 Then 'It might be any account...		nAdvId = Request.QueryString("id")	Else		nAdvId = Session("userfldauto")	End If		oRS.Open "select * from users where fldAuto = " &  nAdvId, ,adOpenKeyset,adLockOptimistic		If g_AdMentor_Demo = False Then		If Request.QueryString("action") = "new" Then			'			If oRS.EOF Then				oRS.AddNew			Else				TrySave = "NameTaken"			oRS.Close			Set oRS = Nothing				Exit Function			End If		Else			'Now, noone can have the same userid...   		 	oRS.MoveLast   	 		oRS.MoveFirst			If oRS.RecordCount > 1 Then   		 		TrySave = "NameTaken"				oRS.Close			Set oRS = Nothing				Exit Function			End If		End If				'Now, make sure new passwords are correct		If Request.Form("pwdnew") <>  Request.Form("pwdnew2") Then			TrySave = "PasswordError"			oRS.Close			Set oRS = Nothing			Exit Function		End If		*****linha 76-->	oRS("name") = sUID	<---******** linha 76			If Request.Form("pwdnew") <> "" Then			oRS("pwd") = Request.Form("pwdnew")		End If		If Session("admin") = 1 Then			'On the form?			If Request.Form("admin") = "" Then				oRS("admin") = 0			Else				oRS("admin") = 1			End If		End If				oRS("emailaddress") = Request.Form("emailaddress")		oRS("fullname") = Request.Form("fullname")				'Now is it myself?		If Request.Form("name") = Session("loginname") Then			Session("admin") = oRS("admin")			Session("loginname") = oRS("name")			Session("password") = oRS("pwd")			Session("fullname") = oRS("fullname")		End If		fAdmin = oRS("admin")		sEmailAddress = oRS("emailaddress")		sFullName = oRS("fullname")		If g_AdMentor_Demo = False Then			oRS.Update		End if		oRS.Close	End If	Set oRS = NothingEnd FunctionSub Main()	Dim oMyConn, oMyRS	Set oMyConn = AdMentor_DBOpenConnection()	If Request.QueryString("save")= "yes" Then 'Yes we are saving...		sError = TrySave( oMyConn )		If sError <> "" Then		' Some error - then restore values			If Request.Form("admin") = "1" Or Request.Form("admin") = "" Then				fAdmin = 1			Else				fAdmin = 0			End If					sEmailAddress = Request.Form("emailaddress")			sFullName = Request.Form("fullname")		End If	ElseIf Request.QueryString("action") = "new" Then		' Do nothing cause it should be empty then...		nAdvId = 0	Else 		'		nAdvId = Request.QueryString("id")		If Session("admin") = 1 Then 'It might be any account...			nAdvId = Request.QueryString("id")		Else			nAdvId = Session("userfldauto")		End If		Set oMyRS = oMyConn.Execute( "select * from users where fldAuto = " & nAdvId )		sUID = oMyRS("name")		fAdmin = oMyRS("admin")		sEmailAddress = oMyRS("EmailAddress")		sFullName = oMyRS("FullName")		oMyRS.Close		Set oMyRS = Nothing	End If	oMyConn.Close	Set oMyConn = NothingEnd Sub%><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><meta name="GENERATOR" content="Microsoft FrontPage 4.0"><meta name="ProgId" content="FrontPage.Editor.Document"><title>Account management</title><style type="text/css"><!--	 body {  font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000}	 td {  font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000}	 th {  font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000}	 A:link {text-decoration: none;}	 A:visited {text-decoration: none;}	 A:hover {text-decoration: underline;}--></style></head><body><table align="center" bgColor="#003399" border="0" cellPadding="3" cellSpacing="0" height="100%" width="100%">  <tbody>	<tr>	  <td vAlign="top" width="50%" height="60">	  <img border="0" src="../../images/administration.gif">	  </td>	  <td vAlign="top" width="468" height="60">	  <b><font color="#FFFFFF" face="verdana,arial,helvetica" size="+2">Administração</font></b>	  </td>	</tr>	<tr>	  <td height="100%" vAlign="top" width="100%" colspan="2">		<table align="center" bgColor="#ffffff" border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%">		  <tbody>			<tr>			  <td height="100%" vAlign="top" width="85%">				<table bgColor="#ffffff" border="0" cellPadding="10" cellSpacing="0" height="100%" width="100%">				  <tbody>					<tr>					  <td align="left" height="100%" vAlign="top" width="65%">						<table border="0" width="100%">						  <tr>							<td width="50%">						<font color="#aa3333" face="verdana,arial,helvetica" size="+2"><b>Manutenção						de Conta </b></font>							</td>							<td width="50%"><%=GetAdminPagesBannerCode()%></td>						  </tr>						</table>						<hr color="#000066" noShade SIZE="1">						<table border="0" width="696">						  <tr>							<td width="160"  valign="top"><%AdAdminWriteMenu%></td>							<td width="522">						 							<form method="POST" action="adminaccount.asp?id=<%=nAdvId%>&Save=yes<%If Request.QueryString("action") = "new" Then Response.Write "&action=new" End If%>">								<table border="0" width="110%"><%If sError = "NameTaken" Then %>									 								  <tr>									<td width="22%"></td>										<td width="94%"><font color="#FF0000" size="1">User										  id is already used by someone else</font></td>								  </tr><%End If%>								  <%If Request.Form("loginname")<> ""  And sError = "" Then %>									 								  <tr>									<td width="22%"></td>										<td width="94%"><font color="#008000" size="1">Alterações										  foram salvas com sucesso</font></td>								  </tr><%End If%>								  								  <tr>									<td width="22%"><b>Usuário</b>:</td><%If Session("admin") = 1 Then %>										<td width="94%"><input type="text" name="loginname" size="15" value="<%=sUID%>" ></td><%Else %>									<td width="62%"><%=sUID%></td><%End If%>																		<td width="78%"></td>								  </tr><%If sError = "PasswordError" Then %>									 								  <tr>									<td width="22%"></td>									<td width="94%"><font size="1" color="#FF0000">Senha									  e confirmação de senha não conferem</font> </td>								  </tr><%End If%>																	  <tr>									<td width="22%"><b>Nova senha</b>:</td>									<td width="94%"><input type="password" name="pwdnew" size="15">									  <font size="1">(Deixe vazio para excluir a									  senha anterior)</font></td>								  </tr>								  <tr>									<td width="22%"><b>Confirme nova senha</b>:</td>									<td width="94%"><input type="password" name="pwdnew2" size="15">									  <font size="1">(Deixe vazio para excluir a									  senha anterior)</font></td>								  </tr><%If Session("admin") = 1 Then %>								  <tr>									<td width="22%"><b>Direitos de Administrador:</b></td>									<td width="94%"><input type="checkbox" name="admin" value="0" <%If fAdmin=1 Then  Response.Write "1"%>></td>								  </tr><%End If %>								  <tr>									<td width="22%"><b>Email :</b></td>									<td width="94%"><input type="text" name="emailaddress" size="40" value="<%=sEmailAddress%>"></td>								  </tr>								  <tr>									<td width="22%"><b>Nome Completo:</b><b> </b></td>									<td width="94%"><input type="text" name="fullname" size="40" value="<%=sFullName%>"></td>								  </tr>								</table>								<p><input type="submit" value="Enviar" name="B1"><input type="reset" value="Cancela" name="B2"></p>							  </form>	 </td>						  </tr>						</table>						<table border="0" width="100%">						  <tr>							<td width="50%">							  <p><br>							  </p>							</td>						  </tr>						</table>					  </td>					</tr>				  </tbody>				</table>			  </td>			</tr>		  </tbody>		</table>	  </td>	</tr>  </tbody></table></body></html>

Galera preciso da ajuda de vcs de novo...

Valeu

Compartilhar este post


Link para o post
Compartilhar em outros sites

você sempre usou esta estrutura para adicionar um registro em MySQL?

oRS.AddNew...oRS.UpdateoRS.Close
caso não, troque por INSERT e faça um teste...

Compartilhar este post


Link para o post
Compartilhar em outros sites

eu costumo usar insert sim, mas como o codigo do Admentor é muito grande, estou tentando deixar do jeito que está... mas sei não.... reprogramar tudo seria muito dificil...

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.