Small company logo:
   History
 
Advertising banner:
 
 Statement.Delete
Home • Help • Customization Tools • FCAS • Language Reference • Statement.Delete
 
Purpose
Deletes the current record and moves the record pointer to the next record. The Delete method can be used on form fields.
There is no warning for deleting records with positioned deletes. Make sure your application deletes only the records you are interested in deleting. Delete confirmations are handled by the application.
81203_40013_5.png        Warning
Any records deleted with this method will be permanently lost.
Syntax
DBStatement.Delete
Compliance:
Level 2
Example
The following example finds a specific record, prints out its information, and then deletes it from the database using a positioned delete.
Sub Main()
        Dim cnct As DBConnection
        Dim stmt As DBStatement
        cnct.OpenConnection("MyDSN")    'Open the data source "MyDSN"
        stmt.OpenStatement(cnct, dbKeyset, dbRowver)
        stmt.ExecuteSQL("SELECT * FROM MyTable WHERE CustNum = 12345")
        Print "Deleting Customer."
        Print "Customer Name:"; stmt.Column("CustName")
        Print "Customer Phone:"; stmt.Column("CustAddr")
        Print "Customer Last Contacted:";
stmt.Column("CustLastContact")
        stmt.Delete                     'Delete the current record
        stmt.CloseStatement     
        cnct.CloseConnection    'Close the connection
End Sub