Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debugging Problem

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Please take a look at this code and tell me why I am having this error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC driver does not support the requested properties.
/EmpDB/Results.asp, line 111
This error on this line:

Call objEmpDetailCommand.Execute()

<HTML>
<HEAD>
<link rel=&quot;stylesheet&quot; href=&quot;default.css&quot; type=&quot;text/css&quot;>

</HEAD>
<BODY>
<%
'*******************************************************************************
'* Name: Results.asp
'* Description:
'* Returns an open ADO Connection object.
'*******************************************************************************
Private Function GetDBConnection

Const cConnection = &quot;DSN=EmpDB;UID=scott;PWD=tiger&quot;

Dim objConnection

'* Create the connection object
Set objConnection = Server.CreateObject(&quot;ADODB.Connection&quot;)
objConnection.ConnectionString = cConnection
objConnection.CursorLocation = 3 '* adUseClient
objConnection.Open

'* Return the new connection back to the calling routine
Set GetDBConnection = objConnection

End Function
%>


<P>
Selected First Name:<%=Request.Form(&quot;FirstName&quot;)%></P>
<%
'************************************************************************
'* Call the GetEmployeeDetails procedure to get their name etc
'************************************************************************
Const cProcName = &quot;{call stp_TEST_GetCV(?, ?, ?, ?, ?,?,?,?,?,?,?,?,?,?)}&quot;

'************************************************************************
'* The position of parameters in the stored proc
'************************************************************************
Const cFirstNameParam = 0
Const cLastNameParam = 1
Const cEmailParam = 2
Const cPhoneParam = 3
Const cFaxParam = 4
Const cAddress1Param = 5
Const cAddress2Param = 6
Const cCityParam = 7
Const cStateParam = 8
Const cZipCodeParam = 9
Const cCountryParam = 10
Const cEducationDetailsParam = 11
Const cYearExperienceParam = 12
Const cExperienceDetailsParam = 13

Dim objEmpDetailCommand '* Command object to execute Stored Procedure

'************************************************************************
'* Set up the command object
'************************************************************************
Set objEmpDetailCommand = Server.CreateObject(&quot;ADODB.Command&quot;)
objEmpDetailCommand.ActiveConnection = GetDBConnection()
objEmpDetailCommand.CommandText = cProcName
objEmpDetailCommand.CommandType = 1 '** adCmdText

'************************************************************************
'* We need to set the direction and value for the input - number 1
'************************************************************************
objEmpDetailCommand.Parameters(cFirstNameParam).Direction = 3
objEmpDetailCommand.Parameters(cLastNameParam).Direction = 3
objEmpDetailCommand.Parameters(cPhoneParam).Direction = 3


'* adParamInput
objEmpDetailCommand.Parameters(cFirstNameParam).Value = Request.Form(&quot;FirstName&quot;) '* Set the input param to the selected ID

'************************************************************************
'* All the others are output so set them so
'************************************************************************
objEmpDetailCommand.Parameters(cEmailParam).Direction = 2 '* adParamOutput
objEmpDetailCommand.Parameters(cFaxParam).Direction = 2 '* adParamOutput
objEmpDetailCommand.Parameters(cAddress1Param).Direction = 2 '* adParamOutput
objEmpDetailCommand.Parameters(cAddress2Param).Direction = 2 '* adParamOutput
objEmpDetailCommand.Parameters(cCityParam).Direction = 2 '* adParamOutput
objEmpDetailCommand.Parameters(cStateParam).Direction = 2 '* adParamOutput
objEmpDetailCommand.Parameters(cZipCodeParam).Direction = 2 '* adParamOutput
objEmpDetailCommand.Parameters(cCountryParam).Direction = 2 '* adParamOutput
objEmpDetailCommand.Parameters(cEducationDetailsParam).Direction = 2 '* adParamOutput
objEmpDetailCommand.Parameters(cYearExperienceParam).Direction = 2 '* adParamOutput
objEmpDetailCommand.Parameters(cExperienceDetailsParam).Direction = 2 '* adParamOutput


'************************************************************************
'* Execute the stored proc
'************************************************************************
Call objEmpDetailCommand.Execute()

'************************************************************************
'* Now we can show the values
'************************************************************************
%>
<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<tr>
<td><B>First Name:</B></td><td><%=objEmpDetailCommand.Parameters(cFirstNameParam).Value%></td>
</tr>
<tr>
<td><B>Last Name:</B></td><td><%=objEmpDetailCommand.Parameters(cLastNameParam).Value%></td>
</tr>
<tr>
<td><B>Email:</B></td><td><%=objEmpDetailCommand.Parameters(cEmailParam).Value%></td>
</tr>
<tr>
<td><B>Phone:</B><td><%=objEmpDetailCommand.Parameters(cPhoneParam).Value%></td>
</tr>
<tr>
<td><B>Fax:</B></td><td><%=objEmpDetailCommand.Parameters(cFaxParam).Value%></td>
</tr>
<tr>
<td><B>Address1:</B></td><td><%=objEmpDetailCommand.Parameters(cAddress1Param).Value%></td>
</tr>
<tr>
<td><B>Address2:</B></td><td><%=objEmpDetailCommand.Parameters(cAddress2Param).Value%></td>
</tr>
<tr>
<td><B>City:</B><td><%=objEmpDetailCommand.Parameters(cCityParam).Value%></td>
</tr>

<tr>
<td><B>State:</B></td><td><%=objEmpDetailCommand.Parameters(cStateParam).Value%></td>
</tr>
<tr>
<td><B>Zip:</B></td><td><%=objEmpDetailCommand.Parameters(cZipCodeParam).Value%></td>
</tr>
<tr>
<td><B>Country:</B></td><td><%=objEmpDetailCommand.Parameters(cCountryParam).Value%></td>
</tr>
<tr>
<td><B>Education Details:</B><td><%=objEmpDetailCommand.Parameters(cEducationDetailsParam).Value%></td>
</tr>

<tr>
<td><B>Years Of Exp:</B></td><td><%=objEmpDetailCommand.Parameters(cYearExperienceParam).Value%></td>
</tr>
<tr>
<td><B>Details Of Exp:</B></td><td><%=objEmpDetailCommand.Parameters(cExperienceDetailsParam).Value%></td>
</tr>
</table>

<% '************************************************************************
'* And that's it - so close objEmpDetailCommand
'************************************************************************
Set objEmpDetailCommand = Nothing
%>

</BODY>
</HTML>

Thanks for sharing your knowledge!!
 
Try taking off the Call from the line you are encountering the error.


objEmpDetailCommand.Execute()
 
But I need that in order to execute the code.
Actually, I tried commenting it out and it just displayed the form fields without their data.
 
Don't remove the whole line, just take the Call statement off of it, so this:

'***********************************************************
'* Execute the stored proc
'*******************************************************
Call objEmpDetailCommand.Execute()


Becomes this:

'***********************************************************
'* Execute the stored proc
'*******************************************************
objEmpDetailCommand.Execute()

 
thanks JuanitaC!
I tried both, even before I posted my thread.
My thinking is that there is some bug in the code that this
objEmpDetailCommand.Execute() is having problem with.
Problem is, I cannot figure it out.
I have already spent two days on this code.
sad

 
While the error doesn't exactly point to it, are you sure you can add Parameters to a Command object without
1. using set ParameterObject=CommandObject.CreateParameter (details )and CommandObject.Parameters.Append ParameterObject, or
2. using CommandObject.Refresh
? codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top