1- how to search about name in database where the table name = names ?
2- how to search about the information between two date?
:confused:
Printable View
1- how to search about name in database where the table name = names ?
2- how to search about the information between two date?
:confused:
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
thanks about that information
interpoll