Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    3

    Unanswered: Finding a Record

    Hello

    I am working with VB6, which I have linked to an Acces db. I used a Data button to link to 'tblmain' in the Acces db. On the VB form, I can view records from this table (next, previous), but I am trying to find a way to find a record on one form using an unbound text box and a command button. I want the user to be able to type a part number in the unbound text box (Text0), then click the command button to search for the matching record. I have this so far:

    Dim rs As ADODB.Recordset

    Set cn = New ADODB.Connection
    cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jsdegard\Desktop\PieceWeight.mdb;User Id=admin;Password=;"

    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open "Select * From tblmain Where Text1='" & Text0.Text & "'", cn, adOpenKeyset, adLockOptimistic

    I am getting an error:

    'No value given for one or more required parameters'

    Any idea what the problem could be? Any thoughts on this would be extremely helpful and appreciated.

    Thanks

    Jeremy

  2. #2
    Join Date
    Nov 2004
    Posts
    108
    maybe that you have no password, if there is no password then ommit the
    Code:
    ...Password=;
    what line does it marks?
    to err is human ; to really mess things up requires a computer

Posting Permissions

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