
June 15th, 2004, 08:29 PM
|
|
Registered User
|
|
Join Date: Apr 2004
Location: Calgary
Posts: 5
Time spent in forums: 1 m 44 sec
Reputation Power: 0
|
|
Deleting an MS Access record in vb.net
I am writing a vb.net application that links to an MS Access database.
The connection and dataset have been declared in a module. The connection works - I have already successfully coded an "Add new row" and a "Select".
Problem is: This delete routine gives me an error message on the line with the "Update". I get a "No value given for one or more required parameters".
I AM STUMPED. SOMEBODY PLEASE HELP!!!!!
Here is my code: ( my connection and dataset are declared in a module)
Try
Dim CmdAdapter AsNew OleDbDataAdapter("select * from Clients where CID=" & CID, dbConn)
Dim CmdUpdate AsNew OleDbCommandBuilder(CmdAdapter)
CmdAdapter.Fill(dbDataset, "clients")
dbDataset.Tables("clients").Rows(0).Delete()
CmdAdapter.Update(dbDataset, "clients")
Catch ex As Exception
MsgBox(ex.ToString)
EndTry
|