Visual Basic - tengo ste cod para borrar, q falla?GRACIAS!!!

Life is soft - evento anual de software empresarial
 
Vista:

tengo ste cod para borrar, q falla?GRACIAS!!!

Publicado por Ainhoa (45 intervenciones) el 17/03/2004 16:42:04
Muchas gracias p resolver mis dudas, pero tngo otra mas, q falla n ste codigo? muxas gracias

Dim x As Integer
Option Explicit
Public izenak As String

Private Sub Command1_Click()
Dim rs As Recordset
Set rs = CreateObject("Adodb.recordset")
Dim cn As Connection
Set cn = CreateObject("Adodb.connection")

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Mis documentos\Ainhoa\ainhoa\piezas - verificadores\PRUEBA.mdb;Persist Security Info=False", "admin"
rs.Open "select * from piezas", cn, 3, 3

rs.Fields(0).Value = Text1.Text
rs.Fields(1).Value = Text2.Text
rs.Fields(2).Value = Text3.Text
rs.Delete
rs.Close
cn.Close

MsgBox "Guardado"
End Sub

Private Sub salir_Click()
Form1.Show
Form4.Hide
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:tengo ste cod para borrar, q falla?GRACIAS!!!

Publicado por Pancho (53 intervenciones) el 17/03/2004 19:03:54
Hola

Dim x As Integer
Option Explicit
Public izenak As String

Private Sub Command1_Click()
Dim rs As Recordset
Set rs = CreateObject("Adodb.recordset")
Dim cn As Connection
Set cn = CreateObject("Adodb.connection")

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Mis documentos\Ainhoa\ainhoa\piezas - verificadores\PRUEBA.mdb;Persist Security Info=False", "admin"
rs.Open "select * from piezas", cn, 3, 3

rs.Add <<<<<<<<<<<<<<< Agregar
rs.Fields(0).Value = Text1.Text
rs.Fields(1).Value = Text2.Text
rs.Fields(2).Value = Text3.Text
rs.Update <<<<<<<<<<<<< Agregar
rs.Delete
rs.Close
cn.Close

MsgBox "Guardado"
End Sub

Private Sub salir_Click()
Form1.Show
Form4.Hide
End Sub

Saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:tengo ste cod para borrar, q falla?GRACIAS!!!

Publicado por Fabian (501 intervenciones) el 17/03/2004 19:34:08
Que pretendes hacer ingresar datos o eliminarlos?
recordset.delete es para borrar
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar