Results 1 to 4 of 4

Thread: 'No value given' error with rs [RESOLVED]

  1. #1

    Thread Starter
    Addicted Member BIOSTALL's Avatar
    Join Date
    Apr 2005
    Location
    Northampton, UK
    Posts
    180

    'No value given' error with rs [RESOLVED]

    Hey

    I have this:
    VB Code:
    1. RS.Close
    2.         RS.Source = "Select * from Cars where Car_Registation = '" & lblCarReg.Caption & "'"
    3.         RS.Open
    4.         StartDate = RS.Fields("Car_DateDueOut")
    5.         EndDate = RS.Fields("Car_DateDueBack")
    6.             If (txtHireDateCommence.Text > StartDate And txtHireDateFinish.Text < EndDate) Then
    7.                 MsgBox "The car is not available to hire out at the specified time. Please go back and select another car", vbExclamation + vbOKOnly, "Car not available"
    8.                 Exit Sub
    9.             End If
    Its giving me the error:

    "No value given for one or more required parameters"

    It then highlights RS.Open I cant figure out what wrong with it. Any suggestions please?? Just ask if u need more information. Thanks

    BIOSTALL
    Last edited by BIOSTALL; Apr 11th, 2005 at 09:28 AM.

  2. #2
    Frenzied Member PilgrimPete's Avatar
    Join Date
    Feb 2002
    Posts
    1,313

    Re: 'No value given' error with rs

    Hi.
    There are generally two reasons for that error:
    1. that you haven't supplied a value for an expected paramter;
    2. you have misspelled a column name, and it thinks you mean a parameter. Is the r missing from Car_Registation deliberately or by mistake..?

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: 'No value given' error with rs

    Normally you need to add some parameters to the .OPEN - such as the CONNCTION and cursor type/location...

    Do all your .OPEN statements look like this?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4

    Thread Starter
    Addicted Member BIOSTALL's Avatar
    Join Date
    Apr 2005
    Location
    Northampton, UK
    Posts
    180

    Re: 'No value given' error with rs

    i set all the properties on form_Load().

    Yeh, i was missing the 'R' *rolls eyes* Cheers

    BIOSTALL

Posting Permissions

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



Click Here to Expand Forum to Full Width