Visual Basic uses Structured Query Language (SQL) to create new dynasets. SQL is an Industrial Standard language for processing relational database.
Visual Basic uses SQL to create new recordsets.Set the data controls RecordSource property to an SQL query and execute a Refresh method
Visual Basic use SQL to select fields and records from a table and join the fields from row tables.
Syntax:
Select [ distinct ] FieldList From TableNames
Where SearchConditions
Group By FieldList
Having GroupCriteria
Order By FieldList
Example:
Select * From Books
Select * From Books, Subjects
Where Books.Subject_Code = Subjects.SubjectCode
Order By Title
Select Distinct Author from Books