EXCLUIR DADOS TABELA VB6
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
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
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[ô])[Ô]
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[ô])[Ô]
Deu certo, obrigado a todos.
Tópico encerrado , respostas não são mais permitidas