Deleting with SQL DELETE

 < Day Day Up > 

Deleting with SQL DELETE

SQL's DELETE statement deletes records and is basically the same as a Delete query created through the Access user interface. The main thing to remember is that you're deleting the entire record, which is why the DELETE clause has no field list argument. This statement takes the form

 

 DELETE FROM datasource [WHERE condition] 

You can specify a field, but doing so is unnecessary and meaningless; the DELETE clause will accept the asterisk character (*), but it's irrelevant and SQL always deletes the entire record. The following statement deletes the record for Don Strong from the Employees table. You probably shouldn't delete this data, because doing so can affect the results of chapter exercises.

 

 DELETE FROM Employees WHERE EmployeeID = 14 

     < Day Day Up > 


    Automating Microsoft Access with VBA
    Automating Microsoft Access with VBA
    ISBN: 0789732440
    EAN: 2147483647
    Year: 2003
    Pages: 186

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net