Hi People
Basically I want to be able to specify a full row of data to be deleted in a ms access db, how do I do this?
Printable View
Hi People
Basically I want to be able to specify a full row of data to be deleted in a ms access db, how do I do this?
Execute a sql delete statement with a where clause to identify which record to delete.
"DELETE Table1.* FROM Table1 WHERE Field1 = 'Something';"
Hi
Thanks for your reply, however I cannot think of a method to delete a particular row, as data will be added and deleted, below is the coding.
p.s. the info entered into the input box, isnt saving to the DB, if anyone has nay ideas?
VB Code:
If x1.Checked Then inputdata(0) = InputBox("How did you solve this problem") 'storing text Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=C:\PermenantDB.mdb;") cn.Open() str = "INSERT INTO Table1 (Column7) VALUES (@Column7)" cmd = New OleDbCommand(str, cn) '##### name cmd.Parameters.Add("@Column7", OleDbType.VarChar) cmd.Parameters("@Column7").Value = (inputdata(0)) 'not saving data? Catch ex As Exception 'Display the error message in a message box then clear the error MsgBox(ex.Message, MsgBoxStyle.OKOnly) Err.Clear() End Try cn.Close() 'only removes records from list boxes, not the database lstid.Items.RemoveAt(1) lstdate.Items.RemoveAt(1) lstname.Items.RemoveAt(1) lstdate.Items.RemoveAt(1) lstproblem.Items.RemoveAt(1) lstproblemdescription.Items.RemoveAt(1) 'then remove row 1 from database End If
If anyone could even attempt to solve why the data entered into the input message box isnt saving to the database, I would really appriciate it.
Still looking at that input message, I have even used a textbox to replaced it as a test, but it still doesnt work. My code is identical to other code which works perfectly.