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="stylesheet" href="default.css" type="text/css">
</HEAD>
<BODY>
<%
'*******************************************************************************
'* Name: Results.asp
'* Description:
'* Returns an open ADO Connection object.
'*******************************************************************************
Private Function GetDBConnection
Const cConnection = "DSN=EmpDB;UID=scott;PWD=tiger"
Dim objConnection
'* Create the connection object
Set objConnection = Server.CreateObject("ADODB.Connection"
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("FirstName"
%></P>
<%
'************************************************************************
'* Call the GetEmployeeDetails procedure to get their name etc
'************************************************************************
Const cProcName = "{call stp_TEST_GetCV(?, ?, ?, ?, ?,?,?,?,?,?,?,?,?,?)}"
'************************************************************************
'* 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("ADODB.Command"
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("FirstName"
'* 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="0" cellpadding="0" cellspacing="0">
<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!!
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="stylesheet" href="default.css" type="text/css">
</HEAD>
<BODY>
<%
'*******************************************************************************
'* Name: Results.asp
'* Description:
'* Returns an open ADO Connection object.
'*******************************************************************************
Private Function GetDBConnection
Const cConnection = "DSN=EmpDB;UID=scott;PWD=tiger"
Dim objConnection
'* Create the connection object
Set objConnection = Server.CreateObject("ADODB.Connection"
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("FirstName"
<%
'************************************************************************
'* Call the GetEmployeeDetails procedure to get their name etc
'************************************************************************
Const cProcName = "{call stp_TEST_GetCV(?, ?, ?, ?, ?,?,?,?,?,?,?,?,?,?)}"
'************************************************************************
'* 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("ADODB.Command"
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("FirstName"
'************************************************************************
'* 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="0" cellpadding="0" cellspacing="0">
<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!!