Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/10/2013, 10:22
frbeltrans
 
Fecha de Ingreso: junio-2012
Mensajes: 44
Antigüedad: 11 años, 10 meses
Puntos: 0
Eliminar Registros DE BASE DE DATOS FOX desde vb.net con ODBC

Buenos Dias este es mi :

Código:
Dim sConn As String
              sConn = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;Exclusive=No;Collate=Machine;NULL=NO;DELETED=YES;BACKGROUNDFETCH=NO;SourceDB=H:\HIS\HISV4\HISDAT"
               Try
            Using cnn As New System.Data.Odbc.OdbcConnection(sConn)
                cnn.Open()
                Dim cmd As System.Data.Odbc.OdbcCommand
                cmd = New System.Data.Odbc.OdbcCommand()
                cmd.Connection = cnn
                cmd.CommandText = "DELETE FROM " & TextBox1.Text & " where NUM_REG=2 and NUM_PAG=9 and nom_lote='40' AND Dia=1 AND cod_2000='000005752'"
                cmd.ExecuteNonQuery()
                cnn.Close()
            End Using
        Catch ex As Exception
            MessageBox.Show("Error al abrir la base de datos" & vbCrLf & ex.Message)
        End Try
    End Sub
Cuando ejecuto la sentencia en fox si me eliminar el registro especificado, pero cuando lo uso en vb.net me borra mas de un registro que no tiene las condiciones que estoy podiendo

Gracias de antemano