DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: ERROR: Too Few Parameters, Expected 1

  1. #1
    Victoria Guest

    ERROR: 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.

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

    Could it be something with the checkboxes??

    Thanks,
    Vic


  2. #2
    Craig Brown Guest

    Re: ERROR: Too Few Parameters, Expected 1


    Victoria,

    Do all of your variables match the database definitions? Usually one gets
    this error when something is missing or perceived to be missing. My guess
    is that if you are sending a value(your variable may be empty, too), you
    are sending the value in one form and the database is expecting another.

    Craig Brown

    "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.
    >
    >I get the error (Too Few Parameters, Expected 1) on the line:
    >dbAsset.Execute strSqlSaveTestT
    >
    >Could it be something with the checkboxes??
    >
    >Thanks,
    > Vic
    >



  3. #3
    Tim Martin Guest

    Re: ERROR: Too Few Parameters, Expected 1


    Vic-
    I agree with Craig. Try breaking your statement up into 3 separate updates
    with only one field each. Perhaps then you can determine if only one of the
    fields is the offender.
    Also, could your column name possibly be "KeyboardTested" not "KeboardTested"?
    Tim

    "Craig Brown" <brownc3@ing-afs.com> wrote:
    >
    >Victoria,
    >
    >Do all of your variables match the database definitions? Usually one gets
    >this error when something is missing or perceived to be missing. My guess
    >is that if you are sending a value(your variable may be empty, too), you
    >are sending the value in one form and the database is expecting another.
    >
    >Craig Brown
    >
    >"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.
    >>
    >>I get the error (Too Few Parameters, Expected 1) on the line:
    >>dbAsset.Execute strSqlSaveTestT
    >>
    >>Could it be something with the checkboxes??
    >>
    >>Thanks,
    >> Vic
    >>

    >



  4. #4
    Victoria Guest

    Re: ERROR: Too Few Parameters, Expected 1


    Your right I did have a spelling mistake, but that didn't help. I removed
    the single quotes and it worked!?!


    Thanks,
    Vic

  5. #5
    Craig Brown Guest

    Re: ERROR: Too Few Parameters, Expected 1


    Victoria,

    I guess that was my point, your database was not expecting a string and you
    sent the data as a string.

    I apologize for not having explained it better.

    Glad to hear it's working!!!

    Craig


    "Victoria" <miwok74@hotmail.com> wrote:
    >
    >Your right I did have a spelling mistake, but that didn't help. I removed
    >the single quotes and it worked!?!
    >
    >
    >Thanks,
    > Vic



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