Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: help!! variable is undefined: adCmdStoredProc


Message #1 by "mario van acker" <mario.vanacker@r...> on Mon, 29 Apr 2002 22:26:14
Can someone help me with this problem:
The goal is to execute an Access2000 Query (Q_T_Leden_WijzigenPasw) by 
giving two parameters (@nieuw_paswoord and @gebruikersnaam).

But I'm getting the following errormessage:
Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'adCmdStoredProc'
/asi42/secure/scriptie/asp/leden/paswijz.asp, line 24

When I add 'adCmdStoredProc' to the Dim statement I get this errormessage:
Error Type:
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in 
conflict with one another.
/asi42/secure/scriptie/asp/leden/paswijz.asp, line 24


This Is the code in PASWIJZ.ASP:

<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>

<!-- #include file="../data/IncConnOpen.asp" -->

<%
Dim objcommand, huidig, nieuw1, nieuw2, paswoord, gebruikersnaam, objrs, 
errorcode
errorcode = 0
gebruikersnaam = cstr(Request.Form("gebruikersnaam"))
paswoord = cstr(Request.Form("paswoord"))
huidig = cstr(Request.Form("huidig"))
nieuw1 = cstr(Request.Form("nieuw1"))
nieuw2 = cstr(Request.Form("nieuw2"))
%>

<%
if (paswoord <> huidig OR nieuw1 <> nieuw2) then
	errorcode = 1
else

Set objCommand = Server.CreateObject("ADODB.Command")
With objCommand
    .ActiveConnection = conn
    .CommandType = adCmdStoredProc            '<---- THIS IS LINE 24
    .CommandText = "Q_T_Leden_WijzigenPasw"
    .Parameters.Append .CreateParameter("@nieuw_paswoord", advarchar, 
adParamInput, 50, nieuw1)
    .Parameters.Append .CreateParameter("@gebruikersnaam", advarchar, 
adParamInput, 50, gebruikersnaam)

End With

Set objRS = objCommand.Execute

end if
paswoord = nieuw1
%>

<!-- #include file="../data/IncConnClose.asp" -->

<HTML>
<HEAD>
	<TITLE>wijzigen paswoord</TITLE>
	<link rel="StyleSheet" href="../thema/Club.css" type="text/css" 
media="screen,print">
	<META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 
GMT"> 	
</HEAD>
<BODY>
	<center>
<%if errorcode = 1 then%>
	<h1>U heeft een fout gemaakt, gelieve U opnieuw aan te melden</h1>
	<p>[ <a href="../toepassing/aanmelden.asp" 
class="notunder">terug</a> ]
<%else%>
	<h1>Paswoord is gewijzigd</h1>
	<p>[ <a href="../toepassing/aanmelden.asp" 
class="notunder">terug</a> ]
<%end if%>
	</center>
</body>
</html>

This is the code of the Query:
PARAMETERS [@nieuw_paswoord] Text ( 255 ), [@gebruikersnaam] Text ( 255 );
UPDATE T_Leden SET T_Leden.Paswoord = [@nieuw_paswoord]
WHERE ((([T_Leden].[Gebruikersnaam])=[@gebruikersnaam]));


Can someone tell me what I'm doing wrong? Thanks
Message #2 by "mario van acker" <mario.vanacker@r...> on Mon, 29 Apr 2002 23:19:24
Although I do not understand all of it, I found the solution myself.
I added following code:
Const adCmdStoredProc = &H0004
Const adParamInput = &H0001
Const adParamOutput = &H0002
Const adVarChar = 200
Const adInteger = 3
Can someone tell me what this means?
Message #3 by "Eric Levine" <eric@d...> on Mon, 29 Apr 2002 18:44:34 -0400
Have you included the Type Library in your code somewhere?

If not, you need to add this code either directly to your page, or have
it within an include file.

<!-- METADATA TYPE="typelib" FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -->

Hope this helps.

Regards,
Eric
-----Original Message-----
From: mario van acker [mailto:mario.vanacker@r...] 
Sent: Monday, April 29, 2002 10:26 PM
To: Access ASP
Subject: [access_asp] help!! variable is undefined: adCmdStoredProc

Can someone help me with this problem:
The goal is to execute an Access2000 Query (Q_T_Leden_WijzigenPasw) by 
giving two parameters (@nieuw_paswoord and @gebruikersnaam).

But I'm getting the following errormessage:
Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'adCmdStoredProc'
/asi42/secure/scriptie/asp/leden/paswijz.asp, line 24

When I add 'adCmdStoredProc' to the Dim statement I get this
errormessage:
Error Type:
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in 
conflict with one another.
/asi42/secure/scriptie/asp/leden/paswijz.asp, line 24


This Is the code in PASWIJZ.ASP:

<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>

<!-- #include file="../data/IncConnOpen.asp" -->

<%
Dim objcommand, huidig, nieuw1, nieuw2, paswoord, gebruikersnaam, objrs,

errorcode
errorcode = 0
gebruikersnaam = cstr(Request.Form("gebruikersnaam"))
paswoord = cstr(Request.Form("paswoord"))
huidig = cstr(Request.Form("huidig"))
nieuw1 = cstr(Request.Form("nieuw1"))
nieuw2 = cstr(Request.Form("nieuw2"))
%>

<%
if (paswoord <> huidig OR nieuw1 <> nieuw2) then
	errorcode = 1
else

Set objCommand = Server.CreateObject("ADODB.Command")
With objCommand
    .ActiveConnection = conn
    .CommandType = adCmdStoredProc            '<---- THIS IS LINE 24
    .CommandText = "Q_T_Leden_WijzigenPasw"
    .Parameters.Append .CreateParameter("@nieuw_paswoord", advarchar, 
adParamInput, 50, nieuw1)
    .Parameters.Append .CreateParameter("@gebruikersnaam", advarchar, 
adParamInput, 50, gebruikersnaam)

End With

Set objRS = objCommand.Execute

end if
paswoord = nieuw1
%>

<!-- #include file="../data/IncConnClose.asp" -->

<HTML>
<HEAD>
	<TITLE>wijzigen paswoord</TITLE>
	<link rel="StyleSheet" href="../thema/Club.css" type="text/css" 
media="screen,print">
	<META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 
GMT"> 	
</HEAD>
<BODY>
	<center>
<%if errorcode = 1 then%>
	<h1>U heeft een fout gemaakt, gelieve U opnieuw aan te
melden</h1>
	<p>[ <a href="../toepassing/aanmelden.asp" 
class="notunder">terug</a> ]
<%else%>
	<h1>Paswoord is gewijzigd</h1>
	<p>[ <a href="../toepassing/aanmelden.asp" 
class="notunder">terug</a> ]
<%end if%>
	</center>
</body>
</html>

This is the code of the Query:
PARAMETERS [@nieuw_paswoord] Text ( 255 ), [@gebruikersnaam] Text ( 255
);
UPDATE T_Leden SET T_Leden.Paswoord = [@nieuw_paswoord]
WHERE ((([T_Leden].[Gebruikersnaam])=[@gebruikersnaam]));


Can someone tell me what I'm doing wrong? Thanks




  Return to Index