Results 1 to 3 of 3

Thread: No value given for one or more required parameters.

  1. #1
    Join Date
    Feb 2008
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default No value given for one or more required parameters.

    I am trying to list 5 most commented news and order them by most commented. I am getting the following error...

    No value given for one or more required parameters.



    PHP Code:
    <% 
        
    Set objCommentedNews Server.CreateObject("ADODB.RecordSet"
        
    objCommentedNews.Open "SELECT TOP 5 N.N_ID, N.TITLE, Count(*) as TotalComments FROM NEWS N LEFT JOIN COMMENTS C on C.N_ID = N.N_ID GROUP BY N.N_ID, N.Title ORDER BY     TotalComments DESC"objConn1

        
    Do While not objCommentedNews.EOF  
    %> 

  2. #2
    Join Date
    Feb 2008
    Location
    Buenos Aires, Argentina
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Most times that error is caused because of a miss spell, could it be "N.ID" instead of "N.N_ID"? Try all named fields and check they're not miss spelled.

  3. #3
    Join Date
    Feb 2008
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I have News and Comments tables in my db file. News table has n_id, title, text, date columns inside. Comments table has com_id, n_id, text columns inside. So I am sure column names are not misspelled.



    I also tried to make it work with these codes. I did not get any errors, it takes 5 news from NEWS table but it is not ordering them from most commented to least order. Any help appreciated...

    Code:
    SELECT TOP 5 N.N_ID, N.TITLE FROM NEWS N LEFT JOIN COMMENTS C on C.N_ID = N.N_ID GROUP BY N.N_ID, N.TITLE ORDER BY Count(C.N_ID) ASC
    Last edited by yeniuye; 02-27-2008 at 11:19 PM.

Bookmarks

Posting Permissions

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