DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Error Message: Too Few Parameters, Expected 1

  1. #1
    Victoria Guest

    Error Message: Too Few Parameters, Expected 1


    Hi!

    I'm trying to update a record in an Access2000 DB. I am trying to send values
    of a checkbox (is it checked or not).
    Here is my String:

    strSqlSaveTestT = "Update AllInfo set KeboardTested = '" & chkKeyT.Value
    & "', MouseTested = '" & chkMouT.Value & "', RamTested = '" & chkRamT.Value
    & "' where MSTag = '" & txtMSTag "'"

    When I do a debug.print strSqlSaveTestT, everything looks normal.

    The error (Too Few Parameters, Expected 1) is on the line:
    dbAsset.Execute strSqlSaveTestT

    Could it be something with the checkboxes??

    Thanks,
    Vic

  2. #2
    Tim Martin Guest

    Re: Error Message: Too Few Parameters, Expected 1


    Vic-
    If you retyped this into your post, then you made at least one mistake.
    You need another ampersand near the end of your last line: after txtMSTag.

    strSqlSaveTestT = "Update AllInfo set KeboardTested = '" & chkKeyT.Value
    & "', MouseTested = '" & chkMouT.Value & "', RamTested = '" & chkRamT.Value
    & "' where MSTag = '" & txtMSTag & "'"
    ^
    --------------------------------------+

    Can you use cut and paste to put the code into your post?
    Tim

    "Victoria" <miwok74@hotmail.com> wrote:
    >
    >Hi!
    >
    >I'm trying to update a record in an Access2000 DB. I am trying to send values
    >of a checkbox (is it checked or not).
    >Here is my String:
    >
    >strSqlSaveTestT = "Update AllInfo set KeboardTested = '" & chkKeyT.Value
    >& "', MouseTested = '" & chkMouT.Value & "', RamTested = '" & chkRamT.Value
    >& "' where MSTag = '" & txtMSTag "'"
    >
    >When I do a debug.print strSqlSaveTestT, everything looks normal.
    >
    >The error (Too Few Parameters, Expected 1) is on the line:
    >dbAsset.Execute strSqlSaveTestT
    >
    >Could it be something with the checkboxes??
    >
    >Thanks,
    > Vic



  3. #3
    huibert Guest

    Re: Error Message: Too Few Parameters, Expected 1


    >strSqlSaveTestT = "Update AllInfo set KeboardTested = '" & chkKeyT.Value
    >& "', MouseTested = '" & chkMouT.Value & "', RamTested = '" & chkRamT.Value
    >& "' where MSTag = '" & txtMSTag "'"


    Victoria,

    I take that MouseTested is a boolean/numerical field. therefore the single
    quotes are out of place. Single quotes are used for strings!

    strSqlSaveTestT = "Update AllInfo set KeboardTested = " & chkKeyT.Value
    & ", MouseTested = " & chkMouT.Value & ", RamTested = " & chkRamT.Value
    & " where MSTag = '" & txtMSTag "'"


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center