Results 1 to 2 of 2

Thread: Searching using the record source property

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    8

    Exclamation

    Using DAO it is possible to search/update the contents of a DBGrid by linking the recordsource of a data control object to an unbound text box such as,

    txtsearch on Change()

    data1.RecordSource = "SELECT * FROM Customer WHERE Surname like " & """" & txtsearch.text & "*"""

    bla bla etc etc

    the DBGrid is of course is bound to Data1.

    How is this method possible in ADO ?? I have tried different ways but get a message saying I can't change the source whilst the connection is open.

    Can anybody help me ??


  2. #2
    Lively Member
    Join Date
    Jun 2000
    Location
    Ontario, Canada.
    Posts
    85

    Cool

    Instead of using the data controller for ADO I have been just setting the grid equal to a defined recordset.

    Like this:

    Set tempRcSet = ("Select * From [table]",dbConnect,....)
    set grid.Datasource = temprcset

    This seems to allow me to change the recordset or recordsource without an error.

    Are You using the OLE Grid as well?? Because this may be causing your problem.

    Hope this helps.

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