I have just started to learn VB.i'm making a database using oracle and vb6.
i have a listbox of items and a search button. one can see the details of a particular item in the listbox in a couple of textboxes in that same form by clicking on the search button. can anybody tell me how to delete only the selected item from the listbox along with its details in the associated textboxes???
plss can somebody help me??-
So, you want to delete the stuff from the VB program, but not the oracle database? The problem, I'm guessing, is that when you delete an item from the listbox, it's not updating the database..... so the information remains? If you post the code, I can take a look for you.
it is deleting from the oracle database,but in my code only the associated text boxes are getting cleared and not the item in the listbox. if i am using prodList.clear then it is clearing the entire list which i dont want. i just want to clear that particular selected item from the listbox, not the rest which i havent selected.
here's the code for deletion:
Private Sub cmdDel_Click()
Dim strMessage As String
' Show contents of buffer and get user input.
Set rs = New ADODB.Recordset
SQL = "SELECT * from product where p_code = " & "'" & prodList.Text & "'"
rs.Open SQL, con, adOpenDynamic, adLockOptimistic
strMessage = "Deletion in progress:" & vbCr & _
"Data in buffer = " & rs!p_code & ", " & _
rs!p_name & " " & vbCr & vbCr
If MsgBox(strMessage, vbYesNoCancel) = vbYes Then
' Delete the record.
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = ""
' Go to the new record and show the resulting data.
MsgBox "Data in recordset Deleted"
MsgBox "No deletion in PRODUCT table."
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...