Search Tools Links Login

Delete Records using ADODB

Posted: 2019-10-04
By: DavidCostelloe
Viewed: 219

Filed Under:

VB6 Databases, VB6 Code Cache

No attachments for this post

Delete a record from a Combo Box selection Using Access Database.

Put a Combobox and a Command Button on a form

Create an Access Database

    With Combo1
        .AddItem "David"
        .AddItem "Bob"
    End With
End Sub

Public Sub Command1_Click()
    Dim MyConn As New ADODB.Connection
    Dim MySql As String

    With MyConn
        .ConnectionString = strJetProvider
    End With
    MySql = MySql & " [Field] ='" & Combo1.Listindex(Combo1.List) & "'"
    MyConn.Execute MySql '* no need for recordset
    Set MyConn = Nothing

End Sub

Special Instructions

This code originally appeared on, and has been republished here with the permission of Andrea Tincani.

Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.