Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/11/2009, 18:01
idalyl
 
Fecha de Ingreso: noviembre-2009
Mensajes: 2
Antigüedad: 15 años, 3 meses
Puntos: 1
Exclamación Ayuda Urgente con eliminación de registros en varias tablas

Hola!! Como estan, soy nueva en este foro y ojalá me puedan ayudar. Estoy trabajando con VB. net 2005 y mysql. Este es mi código

Cita:
If MsgBox("¿Está seguro de eliminar el registro? ", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
Else
If RadioButton3.Checked Then
CONEXION.Open()
Try
ELIMINAR = New MySql.Data.MySqlClient.MySqlCommand(SQL, CONEXION)
ELIMINAR.CommandType = CommandType.Text
ELIMINAR.CommandText = "DELETE inventario_oficina.codprodu FROM inventario_compra,inventario_oficina USING inventario_compra,inventario_oficina WHERE codprodu= " & Me.TextBox2.Text.ToString
Try
If ((ELIMINAR.ExecuteNonQuery <> 0)) Then
MsgBox("DATOS ELIMINADOS")

End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Catch ex As Exception
End Try
CONEXION.Close()
NomprovTextBox.Clear()
NombreproductoTextBox.Clear()
PrecTextBox.Clear()
NumfacturaTextBox.Clear()
End If
Tengo tres tablas, historialinventario, inventario_compra e inventario_oficina. Resulta que tengo que borrar un registro por medio de su codigo. Lo que pasa es que esa consulta de mysql me borra el registro que yo deseo solamente en el inventario de oficina, y en las otras tablas me borra todos los registros T.T.
Si me pudieran ayudar con la sintaxis de esa consulta se los agradecería