elow, can any1 tell me whats the code for deleting a record in a database??
or deleting a row?
my table is consist of fields..
thx in advance to,
' Here is the code -- beware I am deleting all Rows.. Please add condition to the query
' I would also advise you to modify the logic in future, to retain the row and flag the row as delete
Dim Cn As ADODB.Connection '* Connection String
Dim oCM As ADODB.Command '* Command Object
Dim sQuery As String '* Query String
On Error GoTo ADO_ERROR
Set Cn = New ADODB.Connection
Cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='C:\Documents and Settings\160831\My Documents\db4.mdb';Persist Security Info=False"
Cn.ConnectionTimeout = 40
Set oCM = New ADODB.Command
oCM.ActiveConnection = Cn
oCM.CommandText = "Delete From Sample"
MsgBox "Deleted " & lRow & " rows"
Application.StatusBar = False
If Not oCM Is Nothing Then Set oCM = Nothing
If Not Cn Is Nothing Then Set Cn = Nothing
If Err <> 0 Then
Debug.Assert Err = 0
Ty sir ive solve my prob about this