|
 |
asp_databases thread: Variable is Undefined: 'adCmdStoredProc'
Message #1 by "Stephen B Looney" <slooney@l...> on Thu, 20 Jul 2000 18:27:31
|
|
I am trying to use a stored procedure and have consulted my copy of
Beginning ASP 3.0, but there seems to be a problem with the statement
"objComm.CommandType = adCmdStoredProc"
IE tells me:
Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'adCmdStoredProc'
Here is a sample of the code I'm using
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = "Provider=SQLOLEDB;..."
objComm.CommandText = "sp_loginuser"
objComm.CommandType = adCmdStoredProc
Set objParam = objComm.CreateParameter("@UserID", adVarChar,
adParamInput,_
20,"")
objComm.Parameters.Append (objParam)
Set objParam =objComm.CreateParameter ("@Password", adVarChar,_
adParamInput, 20, "")
objComm.Parameters.Append (objParam)
Set objParam = objComm.CreateParameter ("@SessionID", adVarChar,_
adParamInput, 40, "")
objComm.Parameters.Append (objParam)
objComm.Parameters ("@UserID") = UCase(strUserID)
objComm.Parameters ("@Password") = strPassword
objComm.Parameters ("SessionID") = SessionID
Set objRS = objComm.Execute
Set objComm = Nothing
Set objParam = Nothing
Progress = objRS("Progress")
If Progress = 0 Or Progress = 5 Then
Else
Errormsg = Cstr(objRS("Errormsg"))
End If
***END OF CODE***
And if I rem out the CommandType Statement, I get a similiar error for
'adVarChar' that is part of the CreateParameter method.
At this point I don't know what to think
Stephen B Looney
Message #2 by "Blackwelder, Dedra J." <djblackwelder@p...> on Thu, 20 Jul 2000 13:09:26 -0500
|
|
You have to have a reference to this file, or Dim the constants:
<!-- METADATA TYPE="typelib" FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -->
-----Original Message-----
From: Stephen B Looney []
Sent: Thursday, July 20, 2000 2:28 PM
To: ASP Databases
Subject: [asp_databases] Variable is Undefined: 'adCmdStoredProc'
I am trying to use a stored procedure and have consulted my copy of
Beginning ASP 3.0, but there seems to be a problem with the statement
"objComm.CommandType = adCmdStoredProc"
IE tells me:
Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'adCmdStoredProc'
Here is a sample of the code I'm using
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = "Provider=SQLOLEDB;..."
objComm.CommandText = "sp_loginuser"
objComm.CommandType = adCmdStoredProc
Set objParam = objComm.CreateParameter("@UserID", adVarChar,
adParamInput,_
20,"")
objComm.Parameters.Append (objParam)
Set objParam =objComm.CreateParameter ("@Password", adVarChar,_
adParamInput, 20, "")
objComm.Parameters.Append (objParam)
Set objParam = objComm.CreateParameter ("@SessionID", adVarChar,_
adParamInput, 40, "")
objComm.Parameters.Append (objParam)
objComm.Parameters ("@UserID") = UCase(strUserID)
objComm.Parameters ("@Password") = strPassword
objComm.Parameters ("SessionID") = SessionID
Set objRS = objComm.Execute
Set objComm = Nothing
Set objParam = Nothing
Progress = objRS("Progress")
If Progress = 0 Or Progress = 5 Then
Else
Errormsg = Cstr(objRS("Errormsg"))
End If
***END OF CODE***
And if I rem out the CommandType Statement, I get a similiar error for
'adVarChar' that is part of the CreateParameter method.
At this point I don't know what to think
Stephen B Looney
Message #3 by =?iso-8859-1?Q?Gonzalo_Ruiz_de_Villa_Su=E1rez?= <gonzalo.ruizdevilla@a...> on Thu, 20 Jul 2000 20:09:31 +0200
|
|
You forgot to include adovbs.inc
You will find it somewhere in your PC
Put it where you have the asp page and use at the beginning the following
tag
<!-- #include file="adovbs.inc" -->
Cheers,
Gonzalo
-----Mensaje original-----
De: Stephen B Looney []
Enviado el: jueves, 20 de julio de 2000 18:28
Para: ASP Databases
Asunto: [asp_databases] Variable is Undefined: 'adCmdStoredProc'
I am trying to use a stored procedure and have consulted my copy of
Beginning ASP 3.0, but there seems to be a problem with the statement
"objComm.CommandType = adCmdStoredProc"
IE tells me:
Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'adCmdStoredProc'
Here is a sample of the code I'm using
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = "Provider=SQLOLEDB;..."
objComm.CommandText = "sp_loginuser"
objComm.CommandType = adCmdStoredProc
Set objParam = objComm.CreateParameter("@UserID", adVarChar,
adParamInput,_
20,"")
objComm.Parameters.Append (objParam)
Set objParam =objComm.CreateParameter ("@Password", adVarChar,_
adParamInput, 20, "")
objComm.Parameters.Append (objParam)
Set objParam = objComm.CreateParameter ("@SessionID", adVarChar,_
adParamInput, 40, "")
objComm.Parameters.Append (objParam)
objComm.Parameters ("@UserID") = UCase(strUserID)
objComm.Parameters ("@Password") = strPassword
objComm.Parameters ("SessionID") = SessionID
Set objRS = objComm.Execute
Set objComm = Nothing
Set objParam = Nothing
Progress = objRS("Progress")
If Progress = 0 Or Progress = 5 Then
Else
Errormsg = Cstr(objRS("Errormsg"))
End If
***END OF CODE***
And if I rem out the CommandType Statement, I get a similiar error for
'adVarChar' that is part of the CreateParameter method.
At this point I don't know what to think
Stephen B Looney
Message #4 by "Ken Schaefer" <ken.s@a...> on Fri, 21 Jul 2000 14:03:37 +1000
|
|
Did you include the adovs.inc file OR include a reference to the ADO typelib
OR otherwise define the ADO constants yourself?
Put (on one line):
<!-- METADATA TYPE="TypeLib" FILE="C:\Program Files\Common
Files\system\ado\msado15.dll" -->
in your global.asa and restart your application and see what happens :-) (or
include the adovbs.inc file)
Cheers
Ken
----- Original Message -----
From: "Stephen B Looney"
To: "ASP Databases" <asp_databases@p...>
Sent: Thursday, July 20, 2000 6:27 PM
Subject: [asp_databases] Variable is Undefined: 'adCmdStoredProc'
> I am trying to use a stored procedure and have consulted my copy of
> Beginning ASP 3.0, but there seems to be a problem with the statement
> "objComm.CommandType = adCmdStoredProc"
>
> IE tells me:
> Error Type:
> Microsoft VBScript runtime (0x800A01F4)
> Variable is undefined: 'adCmdStoredProc'
>
> Here is a sample of the code I'm using
>
> Set objComm = Server.CreateObject("ADODB.Command")
> objComm.ActiveConnection = "Provider=SQLOLEDB;..."
> objComm.CommandText = "sp_loginuser"
> objComm.CommandType = adCmdStoredProc
>
> Set objParam = objComm.CreateParameter("@UserID", adVarChar,
> adParamInput,_
> 20,"")
> objComm.Parameters.Append (objParam)
>
> Set objParam =objComm.CreateParameter ("@Password", adVarChar,_
> adParamInput, 20, "")
> objComm.Parameters.Append (objParam)
>
> Set objParam = objComm.CreateParameter ("@SessionID", adVarChar,_
> adParamInput, 40, "")
> objComm.Parameters.Append (objParam)
>
> objComm.Parameters ("@UserID") = UCase(strUserID)
> objComm.Parameters ("@Password") = strPassword
> objComm.Parameters ("SessionID") = SessionID
>
> Set objRS = objComm.Execute
>
> Set objComm = Nothing
> Set objParam = Nothing
>
> Progress = objRS("Progress")
> If Progress = 0 Or Progress = 5 Then
> Else
> Errormsg = Cstr(objRS("Errormsg"))
> End If
>
> ***END OF CODE***
>
> And if I rem out the CommandType Statement, I get a similiar error for
> 'adVarChar' that is part of the CreateParameter method.
>
> At this point I don't know what to think
>
> Stephen B Looney
Message #5 by "Sam" <sam@p...> on Fri, 21 Jul 2000 16:36:59 +0800
|
|
When I try to open the recordset for updating, the follwoing error is
generated
ERROR --> Provider error '80040e21'
ERROR --> Multiple-step OLE DB operation generated errors. Check each
ERROR -->OLE DB status value, if available. No work was done.
As a beginner, I am puzzled with these error messages and have no ideas
how to
solve it.
First of all, what is Multiple-step OLE DB? Second, how can I check the
OLD DB
status value. What does the phrase 'no work was done' refer to?
Can somebody help?
best regards
Sam
Message #6 by smartin@c... on Fri, 21 Jul 2000 14:33:58 -0400
|
|
Did you include the ADOVBS.INC file? Without that, the ASP parser has no
idea what adCmdStoredProc means or stands for (just like the error says, you
haven't defined the variable).
-----Original Message-----
From: Stephen B Looney []
Sent: Thursday, July 20, 2000 2:28 PM
To: ASP Databases
Subject: [asp_databases] Variable is Undefined: 'adCmdStoredProc'
I am trying to use a stored procedure and have consulted my copy of
Beginning ASP 3.0, but there seems to be a problem with the statement
"objComm.CommandType = adCmdStoredProc"
IE tells me:
Error Type:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'adCmdStoredProc'
Here is a sample of the code I'm using
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = "Provider=SQLOLEDB;..."
objComm.CommandText = "sp_loginuser"
objComm.CommandType = adCmdStoredProc
Set objParam = objComm.CreateParameter("@UserID", adVarChar,
adParamInput,_
20,"")
objComm.Parameters.Append (objParam)
Set objParam =objComm.CreateParameter ("@Password", adVarChar,_
adParamInput, 20, "")
objComm.Parameters.Append (objParam)
Set objParam = objComm.CreateParameter ("@SessionID", adVarChar,_
adParamInput, 40, "")
objComm.Parameters.Append (objParam)
objComm.Parameters ("@UserID") = UCase(strUserID)
objComm.Parameters ("@Password") = strPassword
objComm.Parameters ("SessionID") = SessionID
Set objRS = objComm.Execute
Set objComm = Nothing
Set objParam = Nothing
Progress = objRS("Progress")
If Progress = 0 Or Progress = 5 Then
Else
Errormsg = Cstr(objRS("Errormsg"))
End If
***END OF CODE***
And if I rem out the CommandType Statement, I get a similiar error for
'adVarChar' that is part of the CreateParameter method.
At this point I don't know what to think
Stephen B Looney
|
|
 |