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!

What does "Too few parameters" mean?

Status
Not open for further replies.

csiwa28

Programmer
Apr 12, 2001
177
0
0
I'm getting a "too few parameters" error and I am confused on what this exactly means. What my SQL is supposed to do is when a user clicks on a hyperlink on the 1st page, they are then directed to a 2nd page where a list pops up. The appropriate information is pulled from a table depending on the value of the hyperlink (Name).

SQL_query = "SELECT Product_comCompanyID FROM Products WHERE ProductTypeID ='" & Request.QueryString("Name") & "'"

Set oRS = oConn.Execute(SQL_query)
 
This error message means that a field name that you have used (in the SELECT or WHERE part) is not a field of the table(s) used in the query.

I could have been more specific if I knew your table or database structure.

Abdou
 
Thanks, I didn't notice it before but I had the names mixed up.
 
too few parameters are only occured when ur sql query is in error.i hope u r using msaccess/sql server.
first of all cut and paste ur query and execute the query by giving a relevent "Product type id"
if the error occurs there.ur sql query is error
this error will occur on passing the wrong param or field name misspelled.please check the spelling and commas. in ur query check this place
"product_co,companyID"
i think u typed m insted of " , ".even it may shows the error like this.

SQL_query = "SELECT Product_comCompanyID FROM Products WHERE ProductTypeID ='" & Request.QueryString("Name") & "'"

i hope this hints will help u to find out the error.

with regards
raghu(webspy)
 
I know this thread goes some way back however if someone out there can help me, I would also like to know what is causing this problem, in my case, if you are actually trying to access a stored query in MSA2000 rather than passing an SQL string from VB6? I am using VB6 sp5, jet4.0 sp3.

The code i am using is as follow;

Dim intVal as long

intVal = 78

Set Rs = New ADODB.Recordset
Set Cmd = New ADODB.Command
Set param1 = Cmd.CreateParameter("paramProdID", adSmallInt, adParamInput, 2)

With Cmd
Set .ActiveConnection = adoConn
.CommandText = "[Productsbyid]"
.CommandType = adCmdStoredProc
.Parameters.Append param1
.Parameters("paramProdID") = IntVal
End With

Set Rs.Source = Cmd
Rs.CursorType = adOpenKeyset
Rs.LockType = adLockOptimistic
Rs.Open

Set Me.adcProdID.Recordset = Rs
Me.adcProdID.Refresh
Me.dbgProdID.DataSource = Me.adcProdID
Me.dbgProdID.HoldFields

Rs.Close

I am trying to populate an Ado Data Control which in turn is binded to a datagrid, on a VB6 form. The message "Too few parameters. Expected 1." appears on the line Me.adcProdID.Refresh.

Please help me out on this one.

Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top