CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Search an Access Database

    How can I search a field in an Access database for a number and display that record?


  2. #2
    Join Date
    Dec 1999
    Location
    Malaysia
    Posts
    56

    Re: Search an Access Database

    Guess you have to use a SQL Query.
    For example, you have a field which stores numbers in a table in an Access database.
    Table = sales
    Field = invoice_num

    So, you would like to search for a particular invoice number like '123', so you build a SQL string like this

    SELECT invoice_num
    FROM sales
    WHERE invoice_num = 123


    The WHERE clause of the SQL query would give you the condition as to what number you want to look for, unless you are looking for a pattern in a field, then, that is another story.

    Hope this helps...

    ____________________________________
    The VB Bugs in my Life...

  3. #3
    Join Date
    Dec 1999
    Location
    india,hyderabad
    Posts
    7

    Re: Search an Access Database

    u can use a Select query as

    str="Select * from table name where field =123 "

    in sql server user
    str=Select * from dsn.dbo.table name where field =123

    Sudharshaan

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

Featured