Delete a Record from a Recordset
Posted by admin - Apr 1, 2008 ADODB, Articles, Dani Vainstein, QTips 0 0 Views : 227 Receive Updates For This Category
Article Tools
- Print this page
- Add Comment
- Send to Friend
- Last Updated on :
Jul 16, 2011
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


