EXCLUIR DADOS TABELA VB6

OMAR2011 25/02/2014 09:16:09
#435257
Basta incrementar.
Mais ou menos assim.
Livre pegado.

Dim Conn As ADODB.Connection
Dim rs As ADODB.Recordset

Private Sub Command1_Click()

If MsgBox([Ô]Deseja excluir o registro atual?[Ô], _
48 + vbYesNo, [Ô]Exclusão de Banco[Ô]) = vbYes Then
[ô]SQL = [Ô]delete from Addresses where Data = #[Ô] & ([Ô]06/01/2013[Ô]) & [Ô]#[Ô]
[ô]SQL = [Ô]delete From Addresses Where data >= #[Ô] & Format([Ô]01/06/2013[Ô], [Ô]dd/mm/yyyy[Ô]) & [Ô]# And Data <= #[Ô] & Format([Ô]10/02/2014[Ô], [Ô]dd/mm/yyyy[Ô]) & [Ô]#[Ô]
[ô]SQL = [Ô]delete from Addresses where Data like [ô][Ô] & txtData.Text & [Ô][ô][Ô]
[ô] SQL = [Ô]delete from Addresses where Data = #[Ô] & txtData.Text & [Ô]#[Ô]
[ô]SQL = [Ô]delete from Addresses where Data= #[Ô] & Format(txtData.Text, [Ô]dd/mm/yyyy[Ô]) & [Ô]#[Ô]
[ô] SQL = [Ô]delete From Addresses Where data >= #[Ô] & Format(txtData.Text, [Ô]dd/mm/yyyy[Ô]) & [Ô]# And Data <= #[Ô] & Format(txtData1.Text, [Ô]dd/mm/yyyy[Ô]) & [Ô]#[Ô]
SQL = [Ô]delete From Addresses Where data BETWEEN #[Ô] & Format(txtData.Text, [Ô]dd/mm/yyyy[Ô]) & [Ô]# And #[Ô] & Format(txtData1.Text, [Ô]dd/mm/yyyy[Ô]) & [Ô]#[Ô]

Conn.Execute SQL
MsgBox [Ô]Registro excluído[Ô]
End If
End Sub

Private Sub Form_Load()
Set Conn = New ADODB.Connection
Set rs = New ADODB.Recordset
Conn.Open [Ô]PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=[Ô] & App.Path & [Ô]\computadores.mdb;Jet OLEDB:Database Password=Library;[Ô]

End Sub
KIMH 25/02/2014 11:09:55
#435266
Tenta assim

conn.Open [Ô]PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=[Ô] & App.Path & [Ô]\computadores.mdb;Jet OLEDB:Database Password=Library;[Ô]

conn.Execute [Ô]Delete From informatica Where data >= CDate([ô]01/02/2013[ô]) And Data <= CDate([ô]28/02/2014[ô])[Ô]
ALEXANDREBS 25/02/2014 21:41:59
#435312

Deu certo, obrigado a todos.



Página 2 de 2 [13 registro(s)]
Tópico encerrado , respostas não são mais permitidas