Results 1 to 3 of 3

Thread: object property execute method question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254

    Question

    Can anybody please tell me what is wrong with the following command? I recieve error message

    "ODBC error .... two few parameters provided. Expected 2"

    Even though the execute method has only OPTIONAL parameters!

    '
    ' Set activeconnection Execute the command
    '
    Dim lc_command As New ADODB.Command

    lc_command.CommandText = "update cartitem set quantity = quantity + 1 where cart_id = lCartID and widget_id = lItemID"

    lc_command.ActiveConnection = lconn
    lc_command.CommandType = adCmdText
    lc_command.Execute


    This is fairly urgent for me, so any response is greatly appreciated.

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Leavenworth KS USA
    Posts
    482
    The ODBC driver errors with "Too few parameters. Expected n." when you have a misspelled field/table name or you have literal special characters, like the pipe ("|") symbol, processed in the where clause. Which error code are you getting? That would give me more to go on.


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254
    Yes mongo, I realised this faux pais about 3 nanoseconds after posting the issue. Thanks for the help anyway.

    lenin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width