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

ADODB.Command Error

Status
Not open for further replies.

davidku

Programmer
Aug 6, 2002
24
MY
Hi ... I am using the following scripts to execute a store procedure in SQL Server. There are more than 30 CreateParameter in this statement. I just show a few.


SET Conn1 = Server.CreateObject("ADODB.Connection")
Conn1.ConnectionTimeout = 60
Conn1.Open "myODBC", session("userid"), session("password")

Set oCmd = Server.CreateObject ( "ADODB.Command" )

With oCmd
.ActiveConnection = Conn1
.CommandType = adCmdStoredProc
.CommandText = "p_exdr0203_REV01"
.Parameters.Append .CreateParameter ( "RETURN_VALUE", adInteger, adParamReturnValue )
.Parameters.Append .CreateParameter ( "@AR_EDRSite", adChar, adParamInput, 2, session("EDRSite"))
.Parameters.Append .CreateParameter ( "@AR_Product", adChar, adParamInput, 30, DB_MPN )
.Parameters.Append .CreateParameter ( "@AR_Package", adChar, adParamInput, 12, DB_Package )

End With

oCmd.Execute , , adExecuteNoRecords

IF CStr( oCmd.Parameters( "RETURN_VALUE" )) = 0 THEN
Response.Write &quot;<TD class=stdfont NOWRAP><FONT color=BLUE>Success !</FONT></TD>&quot;
ELSE
Response.Write &quot;<TD class=stdfont NOWRAP><FONT color=RED>&quot; & CStr( oCmd.Parameters( &quot;RETURN_VALUE&quot; )) & &quot;</FONT></TD>&quot;
END IF

Set oCmd = Nothing
Set Conn1 = Nothing


My question is, what is the total CreateParameter we allow to use and I can't execute this statement at all. The error message I am getting is,

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
[Microsoft][ODBC SQL Server Driver]Optional feature not implemented

Any help ?
 
I'm not sure where you are getting the error from, but you could simplify your code like this....


dim objCmd
set objCmd = server.createobject(&quot;adodb.command&quot;)
Set objCmd.ActiveConnection = objConn
with objCmd
.commandText = &quot;sp_templateComplete&quot;
.CommandType = adCmdStoredProc
.parameters(0).direction = adParamReturnValue
.parameters(1) = tempID
.parameters(2) = &quot;tbsTmpltProjNew&quot;
.parameters(3) = personID
.parameters(4) = null
.Execute
End With

IF objCmd.parameters(0) = 0 THEN.... -- Just trying to help...
[wolf]<--- This is a wolf? We need a new icon.......
mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top