Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

search access database

Discussion in 'Information Technology' started by zwasdl@gmail.com, Jul 28, 2006.

  1. zwasdl@gmail.com

    zwasdl@gmail.com
    Expand Collapse
    Guest

    How do I search an access database to find all the queries containing
    certain word, say "cost"

    Thanks a lot,

    Wei
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Indian American Couple Donates For Sikh, Punjabi Culture Research In US Breaking News Aug 19, 2016
    Soul Search By Swarn Singh Bains Book Reviews & Editorials May 25, 2016
    Harpal Singh Kumar Cancer Researcher Knighted By Queen Elizabeth II Sikh Personalities Jan 5, 2016
    Movies Ashdoc's Movie Review---dozakh In Search Of Heaven ( 2015 ) Theatre, Movies & Cinema Apr 6, 2015
    Research Shows NFL Quarterbacks Play Better With Beards Business, Lifestyle & Leisure Nov 23, 2014

  3. Pat Hartman\(MVP\)

    Pat Hartman\(MVP\)
    Expand Collapse
    Guest

    There is no built in facility that supports this. You'll need a third party
    tool. You can purchase speed ferret or search for freeware/shareware
    options.

    <zwasdl@gmail.com> wrote in message
    news:1149879353.555271.81790@i40g2000cwc.googlegroups.com...
    > How do I search an access database to find all the queries containing
    > certain word, say "cost"
    >
    > Thanks a lot,
    >
    > Wei
    >
     
  4. John Vinson

    John Vinson
    Expand Collapse
    Guest

  5. Jamie Collins

    Jamie Collins
    Expand Collapse
    Guest

    zwasdl@gmail.com wrote:
    > How do I search an access database to find all the queries containing
    > certain word, say "cost"


    An 'Access query' can be either a Jet VIEW or a Jet PROCEDURE. You can
    filter their respective definitions using your search word:

    Sub SearchQueries()

    Dim con
    Set con = CreateObject("ADODB.Connection")
    With con
    .CursorLocation = 3
    .Open _
    "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data source=C:\MyDB.mdb"

    Dim rs
    Dim row
    Dim colNames

    Set rs = .OpenSchema(23) ' VIEWs
    rs.Filter = "VIEW_DEFINITION LIKE '%cost%'"
    For row = 0 To rs.RecordCount - 1
    colNames = colNames & _
    rs.Fields("TABLE_NAME").Value & vbCr
    rs.MoveNext
    Next

    Set rs = .OpenSchema(16) ' PROCEDUREs
    rs.Filter = "PROCEDURE_DEFINITION LIKE '%cost%'"
    For row = 0 To rs.RecordCount - 1
    colNames = colNames & _
    rs.Fields("PROCEDURE_NAME").Value & vbCr
    rs.MoveNext
    Next

    MsgBox colNames

    .Close
    End With

    End Sub

    Jamie.

    --
     

Share This Page