Delete a Record from a Recordset

Article Tools

The following code demonstrates how to delete a record from a table. The example uses the Flight Reservation Database ( non default records )

 

Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set oConn = CreateObject( "ADODB.Connection" )
Set oRst = CreateObject( "ADODB.Recordset" )

oConn.Open "QT_Flight32"
oRst.CursorLocation = adUseClient
sql = "SELECT * FROM Orders"
oRst.Open sql, oConn, adOpenStatic, adLockOptimistic
searchCriteria = "Order_Number = 12"
oRst.Find searchCriteria
oRst.Delete
oRst.Close : oConn.Close

 

Previous postDetermine the Day of the Week Next postCreate a Table in a JET Database

Related Posts

Post Your Comment

You must be logged in to post a comment.