Link to home
Start Free TrialLog in
Avatar of ab2ae
ab2ae

asked on

Delete row from database using oledbcommand

Hi experts,

here is my code, i just want to delete a row in the database based on an SQL statement

Dim cn As OleDbConnection

'connection string (path of database)
        strConn = "Provider = Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=" & dataSource

        'creating a new connection object with connection string
        cn = New OleDbConnection(strConn)

        'opening the connection
        cn.Open()

strSQL = "DELETE * " & _
            "FROM PlayList " & _
            "WHERE userID = " & userID & " AND playListTitle = " & playListName & " "

            cmd = New OleDbCommand(strSQL, cn)
            cmd.ExecuteNonQuery()       '*****ERROR*****  no value given for one or more required parameters

I have no idea what the error above means but need this working today!
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ab2ae
ab2ae

ASKER

brilliant!! :o)