INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Error calling store procedure in VBscript

Error calling store procedure in VBscript

(OP)
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
 

RE: Error calling store procedure in VBscript

CommandText is part of ADODB.Command: not ADODB.Connection

RE: Error calling store procedure in VBscript

(OP)
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
 

RE: Error calling store procedure in VBscript

(OP)
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"
    cmd.CommandType = adCmdStoredProc        ' <<<<< Line 27
    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
 

RE: Error calling store procedure in VBscript

Possibly adCmdStoredProc is not defined.  See if 4 works.

http://www.w3schools.com/ado/prop_comm_commandtype.asp

If you get errors on CreateParameter, try 3 for adInteger http://www.w3schools.com/ado/prop_para_type.asp and 1 for adParamInput http://www.w3schools.com/ado/prop_para_direction.asp .

The last bit before the execute should be

CODE

    cmd.Parameters.Append ParmeterID
    cmd.Parameters.Append ParmeterPos

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close