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

Error calling store procedure in VBscript

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
0
36
US
It just has two parameters ID, Pos
Error:
Microsoft VBScript runtime error '800a01be'

Object doesn't support named arguments: 'CommandText'

/sp/saveit.asp, line 24
----------

Code:
	ID=Request.QueryString("ID")
	Pos=Request.QueryString("Pos")
	
	Set cmd = server.CreateObject("ADODB.Connection")
	cmd.Open "driver=SQL Server;server=000.000.000.000;uid=user;pwd=Password;database=mydb;"

	cmd.CommandText = "InsertTransaction"
	cmd.CommandType = adCmdStoredProc
	cmd.Parameters.Refresh

	cmd.Parameters(1) =ID
	cmd.Parameters(2) = Pos
	
	cmd.Execute

DougP
 
CommandText is part of ADODB.Command: not ADODB.Connection
 
OK Thanks for that info.
I have to open a connection this is to a hosted site so I have to connect that way.
But what do I need to add to get to the "command" part?
Can you assist in modify this to make it work? I know some of this code but not much.
TIA

DougP
 
OK I got this now, but getting error
--------
ADODB.Command error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/sp/saveit.asp, line 27
---------------
Code:
	Set Conn = server.CreateObject("ADODB.Connection")
	Set cmd = server.CreateObject("ADODB.Command")

	Conn.ConnectionString ="driver=SQL Server;server=205.178.152.126;uid=robot_admin;pwd=Pass-123;database=robots2000;"
    
	cmd.CommandText = "InsertTransaction"
	[COLOR=red]cmd.CommandType = adCmdStoredProc        ' <<<<< Line 27[/color]
	cmd.Parameters.Refresh
	
    cmd.ActiveConnection = Conn.ConnectionString
    'Set objparameter=objcommand.CreateParameter (name,type,direction,size,value)' see 

	Set ParmeterID = cmd.CreateParameter("Student_ID", adInteger, adParamInput,StudentID)
	Set ParmeterPos =cmd.CreateParameter("Position" , adInteger, adParamInput,Position )
	
	cmd.ParametersAppend(1) = ParmeterID 
	cmd.ParametersAppend(2) = ParmeterPos 
	
	cmd.Execute

	Conn = nothing
	cmd = nothing
	ParmeterID  = nothing
	ParmeterPos  = nothing

DougP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top