|
-
May 3rd, 2002, 05:55 PM
#1
Thread Starter
Member
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?
-
May 3rd, 2002, 07:14 PM
#2
Hyperactive Member
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:
Const DBPATH As String = "C:\Program Files\Microsoft Visual Studio\VB98\nwind.mdb"
Private Sub Form_Load()
Me.AutoRedraw = True
Dim conn As New ADODB.Connection
Dim rsSchema As ADODB.Recordset
conn.Open "provider=Microsoft.jet.oledb.4.0;data source =" & DBPATH
Set rsSchema = conn.OpenSchema(adSchemaTables, Array(Empty, Empty, Empty, "Table"))
Do While Not rsSchema.EOF And Not rsSchema.BOF
Me.Print rsSchema!Table_Name
rsSchema.MoveNext
Loop
Set rsSchema = Nothing
Set conn = Nothing
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
-
May 4th, 2002, 03:02 AM
#3
Thread Starter
Member
thanks mr.Regan
thanks about that information
interpoll
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|