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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No value given for one or more parameter

    Hi,
    I am getting the " no value given for one or more".... error. I get the error as soon as i put the date functions in the query.

    Code:
    <%
    Dim storeMonth 
    'Opening a text file to get the month
    Set fs=Server.CreateObject("Scripting.FileSystemObject")
    
    Set f=fs.OpenTextFile(Server.MapPath("settings.dat"), 1)
    storeMonth=f.readall
    
    
    'Done reading
    
       Set rscount = Server.CreateObject("ADODB.Recordset")
    ' Initialization '
    cnstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath("data1.mdb")
    
    sqlquery = "SELECT Count(id) as temp FROM data where Month(Date_Recv)=Month(Date()) and Year(Date_Recv)=Year(Date())"
    
    ' Open the connection and populate the recordset '
    rscount.open sqlquery,cnstring
    ' Test if there are any records '
    If not rscount.eof then
    ' Move to the first record'
    rscount.MoveFirst
    Response.Write "<tr><td>"& storeMonth& "</tr></td>"
    
    
    While rscount.EOF = false
    
    	Response.Write "<tr><td>" & rscount.Fields("temp").Value & "</td></tr>"
    rscount.movenext
    Wend
    
    end if
    
    ' Close the recordset / connection '
    rscount.close
    
    ' Garbage collection / memory management'
    set rscount = nothing
    f.Close
    Set f=Nothing
    Set fs=Nothing
    
    %>
    
    thanks in advance to anyone who helps.
    DA

  • #2
    Regular Coder
    Join Date
    Jan 2005
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try concatenating the sql string
    Code:
    "SELECT Count(id) as temp FROM data where Month(Date_Recv)='" & Month(Date()) & "' and Year(Date_Recv)='" & Year(Date()) & "'"

  • #3
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks I am still getting the same error.

  • #4
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Can you do a response.write of the sqlquery?

    Code:
    sqlquery = "SELECT Count(id) as temp FROM data where Month(Date_Recv)=Month(Date()) and Year(Date_Recv)=Year(Date())"
    '
    response.write sqlquery
    response.flush
    '
    '
    That will tell you what is missing and may help you figure this out. It may not be a missing parameter, rather a parameter of an incorrect type, i.e. you are looking for a date and it's returning a string.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #5
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks a bunch! The field name i was using was wrong.


  •  

    Posting Permissions

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