Too few parameter Expected 1-VBForums
Results 1 to 7 of 7

Thread: Too few parameter Expected 1

  1. #1

    Thread Starter
    Registered User
    Join Date
    Dec 2017
    Posts
    2

    Too few parameter Expected 1

    I am using a vb6 and the query that i am using is this

    SELECT Count(txt_LNOSCLT.[customer_no]) AS kount, '123' AS amounts
    FROM txt_LNOSCLT;

    Is there any wrong with the query. This is an old MSAccess97.
    Please help. Thanks

  2. #2
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    577

    Re: Too few parameter Expected 1

    "Parameter count" errors are frequently caused by spelling mistakes.

    Either something in the query is spelled incorrectly or something in the Access database (column name, perhaps?) has changed since this code was written.

    Regards, Phill W.

  3. #3
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    6,357

    Re: Too few parameter Expected 1

    I don't know if there is anything 'wrong' with it. When you execute that statement, what do you get? An error? An unexpected result? Do you meant 'old MSAccess97' because it is a 97 version vice a 2016 version, or was the query written a long time ago and it once worked?

  4. #4
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    6,357

    Re: Too few parameter Expected 1

    This looks suspicious: '123'

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    6,357

    Re: Too few parameter Expected 1

    Just do the latter part of your query, "SELECT '123' AS amounts FROM txt_LNOSCLT;" what happens?
    Is 123 a field name?

  6. #6
    Fanatic Member
    Join Date
    Apr 2012
    Posts
    906

    Re: Too few parameter Expected 1

    Quote Originally Posted by SamOscarBrown View Post
    Just do the latter part of your query, "SELECT '123' AS amounts FROM txt_LNOSCLT;" what happens?
    Is 123 a field name?
    That's perfectly valid SQL (though I can't imagine why it's needed in this case). It's just a literal string that is being selected and aliased as 'Amounts'.
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  7. #7
    Frenzied Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    1,439

    Re: Too few parameter Expected 1

    What type of object is: txt_LNOSCLT ? A table of database?

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.