Presentation is loading. Please wait.

Presentation is loading. Please wait.

Please see speaker notes for additional information!

Similar presentations


Presentation on theme: "Please see speaker notes for additional information!"— Presentation transcript:

1 Please see speaker notes for additional information!
SQL with VB and Access Please see speaker notes for additional information! Please check information on SQL from other sources.

2 SQL, ADO, Access At the Record Source for the ADO Contro click on ... to bring up the Property Pages as shown above.

3 Change to 1 - adCmdText and enter the SQL command.
SQL, ADO, Access Change to 1 - adCmdText and enter the SQL command. You need to change to 1 adCmdText and deactivate Table or stored procedure name as Donor you can delete it or have it deactivated when you switch to adCmdText. select * means to select all fields and all records. I am only showing 3 fields so that is all that will appear from gives the name of the table that is being used.

4 SQL, ADO, Access All five records are now available because
Select * from donor2000 means select all records.

5 SQL, ADO, Access This select is looking for all records where DCity = Fall River or Braintree.

6 SQL, ADO, Access These are the only two records on the database that meet the criteria.

7 Note that the record source now shows the SQL code.
SQL, ADO, Access Note that the record source now shows the SQL code. After the SQL code was keyed in, it appeared in the record source.

8 SQL, ADO, Access Note that only one record met the criteria of DrYrFirst > 1999 and Dcontact = Ann Smith. Note that these are string fields so the value you compare against is enclosed in quotes. This is not required for numeric data. Both conditions had to be true.

9 Only the last record was not selected.
SQL, ADO, Access Only the last record was not selected. The like used "19%" which means 19 followed by anything - a wildcard.

10 SQL, ADO, Access Only these three are selected and they are in order by city so New Bedford is shown first, followed by Quincy, followed by Weymouth (alphabetic order by city). Note that this used city in the criteria even though city is not shown on the form. Error messages arise if you have fields on the form that will remain empty because of the select.


Download ppt "Please see speaker notes for additional information!"

Similar presentations


Ads by Google