-
Dec 6th, 2017, 09:35 PM
#1
Thread Starter
Registered User
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
-
Dec 7th, 2017, 06:58 AM
#2
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.
-
Dec 7th, 2017, 07:39 AM
#3
Re: Too few parameter Expected 1
This looks suspicious: '123'
-
Dec 7th, 2017, 07:42 AM
#4
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?
-
Dec 7th, 2017, 07:57 AM
#5
Re: Too few parameter Expected 1
Originally Posted by SamOscarBrown
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
-
Dec 7th, 2017, 07:35 AM
#6
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?
-
Dec 7th, 2017, 09:05 AM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|