Results 1 to 2 of 2

Thread: Required Parameters

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2004
    Location
    Tampa, Fl
    Posts
    39

    Required Parameters

    Hi,
    What is wrong with this

    VB Code:
    1. Private Sub cmdSearch_Click()
    2. If Trim(txtPs.Text) <> "" Then
    3.   'we have something in the text box
    4.      rs.Open "SELECT * FROM UNPW WHERE unpw Like '" & Trim(txtPs.Text) & "'", cn, adOpenKeyset, adLockBatchOptimistic, adCmdText
    5.    If rs.EOF Then
    6.     'nothing was returned
    7.      txtUn.Text = ("NONE FOUND")
    8.      txtPw.Text = ("NONE FOUND")
    9.    Else
    10.     'We have one or more results
    11.      
    12.      txtUn.Text = rs.Fields("UserName")
    13.      txtPw.Text = rs.Fields("PassWord")
    14.    
    15.   End If
    16. End If
    17. rs.Close
    18. End Sub



    I get this error

    No value given for one or more required parameters.

    This code i working on another program I have, but for some reason it will not work on this one.

    Thanks

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by mhipate
    Hi,
    What is wrong with this

    VB Code:
    1. Private Sub cmdSearch_Click()
    2. If Trim(txtPs.Text) <> "" Then
    3.   'we have something in the text box
    4.      rs.Open "SELECT * FROM UNPW WHERE unpw Like '" & Trim(txtPs.Text) & "'", cn, adOpenKeyset, adLockBatchOptimistic, adCmdText
    5.    If rs.EOF Then
    6.     'nothing was returned
    7.      txtUn.Text = ("NONE FOUND")
    8.      txtPw.Text = ("NONE FOUND")
    9.    Else
    10.     'We have one or more results
    11.      
    12.      txtUn.Text = rs.Fields("UserName")
    13.      txtPw.Text = rs.Fields("PassWord")
    14.    
    15.   End If
    16. End If
    17. rs.Close
    18. End Sub



    I get this error

    No value given for one or more required parameters.

    This code i working on another program I have, but for some reason it will not work on this one.

    Thanks
    Isn't this VB6 code ??

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