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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedures

Status
Not open for further replies.

ducky62

Programmer
Jul 10, 2001
24
CA
Hi, Im tring to run a stored procedure and I keep getting the following error:

Add
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
[Microsoft][ODBC SQL Server Driver]Optional feature not implemented
/colo/power/power_1_r.asp, line 48

The code I'm trying to execute is:

Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open "Driver={SQL Server}; Server=mtrlpqbh704; Database=nptt;
UID=nptt_admin;PWD=1nptt2go"
Set objCommand = Server.CreateObject("ADODB.Command")

' Check permission on current file given action and user group

' usp add/update info (and check business rules)
Set objCommand.ActiveConnection = objConnection
With objCommand
.CommandType = adCmdStoredProc
If action = "Add" Then
.CommandText = "usp_PowerL1_Add"
.Parameters.Append .CreateParameter("return", adInteger, adParamReturnValue)
Else
.CommandText = "usp_PowerL1_Update"
.Parameters.Append .CreateParameter("return", adInteger, adParamReturnValue)
.Parameters.Append .CreateParameter("projectid", adInteger, adParamInput, 4, projectid)
End If
.Parameters.Append .CreateParameter("txtWBSNum", adVarChar, adParamInput, 50, txtWBSNum)
.Parameters.Append .CreateParameter("txtNetworkNum", adVarChar, adParamInput, 50, txtNetworkNum)
.Parameters.Append .CreateParameter("txtCLLI", adVarChar, adParamInput, 50, txtCLLI)
.Parameters.Append .CreateParameter("txtNPA", adVarChar, adParamInput, 50, txtNPA)
.Parameters.Append .CreateParameter("txtAddress", adVarChar, adParamInput, 50, txtAddress)
.Parameters.Append .CreateParameter("txtLocationCode", adVarChar, adParamInput, 50, txtLocationCode)
.Parameters.Append .CreateParameter("txtProjectDescription", adVarChar, adParamInput, 50, txtProjectDescription)
.Parameters.Append .CreateParameter("txtEngineeringContractor", adVarChar, adParamInput, 50, txtEngineeringContractor)
.Parameters.Append .CreateParameter("txtInstallationContractor", adVarChar, adParamInput, 50, txtInstallationContractor)
.Parameters.Append .CreateParameter("txtEquipmentSupplier", adVarChar, adParamInput, 50, txtEquipmentSupplier)
.Parameters.Append .CreateParameter("dtmSA", adDate, adParamInput, 10, dtmSA)
.Parameters.Append .CreateParameter("dtmCA", adDate, adParamInput, 10, dtmCA)
.Parameters.Append .CreateParameter("dtmD_P", adDate, adParamInput, 10, dtmD_P)
.Parameters.Append .CreateParameter("dtmH_P", adDate, adParamInput, 10, dtmH_P)
.Parameters.Append .CreateParameter("dtmK_P", adDate, adParamInput, 10, dtmK_P)
.Parameters.Append .CreateParameter("dtmS_P", adDate, adParamInput, 10, dtmS_P)
.Execute
End With

Set objCommand = Nothing
Set objConnection = Nothing

and it screws up at the .Execute statment(line 48).

Any help you could give me on the subject would be greatly appreciated...

thx Derek McCart
 
Check these links for possible reasons for the error.


You probably need to use a different type for the date parameter instead of adDate - perhaps advarchar or adtimestamp. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top