How to delete a ROW that i click from FLEXSRID?
here is my code
Code:
On Error GoTo ErrDelete
Dim sqlStr As String
If MsgBox(" ", vbQuestion + vbYesNo, " Deleted ") = vbYes Then
sqlStr = " Delete STR_ITEMNO,STR_FLOWER,STR_QTY from STRUCTURE "
Else
Exit Sub
End If
Conn.BeginTrans
Conn.Execute sqlStr
Conn.CommitTrans
MsgBox ""
ExitError:
Exit Sub
ErrDelete:
Conn.RollbackTrans
MsgBox "Error:" & Err.Description, vbCritical
Resume ExitError
Unload Me
Form1.Show
but it will delete my all data in table,
if i choose delete from strucuture where str_itemno...
it will delete my all foreign-key,
i want to delete one row at a time then my foreign-key will allow to be redundant...
plse help me..
Re: How to delete a ROW that i click from FLEXSRID?
Thread moved to 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)
The Delete statement always deletes entire rows, so listing fields does not make sense (either use * or nothing).
It will also delete all rows from the table unless you give it a Where clause which specifies the row(s) to delete. What you should use in the Where clause depends on your application and database, but is likely to be something like "WHERE uniqueField = value".
I don't know what you meant by "it will delete my all foreign-key", but it sounds like you are not using the correct condition(s) in the Where clause.
Re: How to delete a ROW that i click from FLEXSRID?
Duplicate threads merged - please post each question (or variation of it) only once.