Results 1 to 3 of 3

Thread: how to search

  1. #1

    Thread Starter
    Member
    Join Date
    May 2002
    Location
    USA
    Posts
    59

    Post how to search

    1- how to search about name in database where the table name = names ?

    2- how to search about the information between two date?
    in arsene we trust ..

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    ON, CAN
    Posts
    265
    hello,

    you can open a database schema recordset and itterate the tables to check if one exist. the following will show you how to loop through the recordset, you can add an If statement to check for a specific table.

    VB Code:
    1. Const DBPATH As String = "C:\Program Files\Microsoft Visual Studio\VB98\nwind.mdb"
    2.  
    3. Private Sub Form_Load()
    4.    
    5.     Me.AutoRedraw = True
    6.    
    7.     Dim conn As New ADODB.Connection
    8.     Dim rsSchema As ADODB.Recordset
    9.    
    10.     conn.Open "provider=Microsoft.jet.oledb.4.0;data source =" & DBPATH
    11.    
    12.     Set rsSchema = conn.OpenSchema(adSchemaTables, Array(Empty, Empty, Empty, "Table"))
    13.    
    14.     Do While Not rsSchema.EOF And Not rsSchema.BOF
    15.         Me.Print rsSchema!Table_Name
    16.         rsSchema.MoveNext
    17.     Loop
    18.    
    19.    
    20.     Set rsSchema = Nothing
    21.     Set conn = Nothing
    22.    
    23. End Sub

    to "search by dates" you can either apply a filter to the recordset by setting the .Filter property, or you can retrieve records from the database that satisfiy the dates domain specified in the WHERE clause in the SELECT statement.

    hope that helps.

    Regan
    For excellent Winsock example check here WINSOCK

  3. #3

    Thread Starter
    Member
    Join Date
    May 2002
    Location
    USA
    Posts
    59

    thanks mr.Regan

    thanks about that information

    interpoll
    in arsene we trust ..

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