Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts

    No value given for one or more required parameters.

    Hi all, I can't get this query to work. Can you help, please?

    Code:
    strSQL = "SELECT Inventory.*, InventoryData.* FROM Inventory INNER JOIN InventoryData ON Inventory.InventoryID = InventoryData.InventoryID "_
    & "WHERE "&SrchTypeCriteria&" LIKE '%" & Replace(strSearch, "'", "''") & "%' AND ShowStock=True"
    I know its the ShowStock=True thats casing the issues.

    The error coming back is

    error '80040e10'

    No value given for one or more required parameters.
    PS I need the Replace function in the query
    Kind regards,
    Mike Hughes

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,603
    Thanks
    80
    Thanked 4,634 Times in 4,596 Posts
    Depends on what DB you are using. Some DBs don't use or recognize the keyword True.

    But in any case, DEBUG DEBUG DEBUG.

    After the line you show there, add:
    Code:
    Response.Write "<hr/>DEBUG SQL: " & strSQL & "<hr/>" & vbNewLine
    and show us what that shows you.

    ************

    On another note...

    Doing this:
    Code:
    SELECT Inventory.*, InventoryData.*
    is a really bad idea. You should figure out only and exactly what fields you need from each table and only SELECT those fields.

    Among other things, your code will execute faster. And you won't have a conflict when you try to get fields from the recordset, as you will now having two InventoryID fields.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Hi, I do use debug, I use response(sql) that works for me. the database is access. I don't need anything morr than this just now.

    Code:
    SELECT Inventory.*, InventoryData.* FROM Inventory INNER JOIN InventoryData ON Inventory.InventoryID = InventoryData.InventoryID WHERE CompanyName LIKE '%%%' AND ShowStock=True
    Microsoft JET Database Engine error '80040e10'
    
    No value given for one or more required parameters.
    
    /Search_Assets.asp, line 140
    I know true works in access as I have it in a different query but not as long winded as this.

    Any help would be great.

    Thanks

    Mike
    Kind regards,
    Mike Hughes

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,603
    Thanks
    80
    Thanked 4,634 Times in 4,596 Posts
    Okay, so copy that query from the debug output into Access and try it there.

    Access-the-program will often give you better diagnostics then Access-as-a-database.

    For example, it may prompt you to enter a value for an undefined field name. (At which point you realize you spelled the field name wrong, typically.)
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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