Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/09/2005, 11:57
Avatar de aldo1982
aldo1982
 
Fecha de Ingreso: noviembre-2004
Ubicación: Santa Fe (Argentina) Colon F.C
Mensajes: 1.362
Antigüedad: 19 años, 6 meses
Puntos: 6
aca te dejo un ejemplo

bué este ejemplo es con db acces, es de inserción de colores, cambiale las tablas y listo

Private Sub botondeinserción_Click()
Text1.Text = UCase(Text1.Text)
If Text1.Text = "" Then
MsgBox "Error: Ingresar datos en el color que desea ingresar", vbExclamation, "Error"
Text1.SetFocus
Exit Sub
End If

Set dbconn = New ADODB.Connection
dbconn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;Persist Security Info=False"
dbconn.Open
SQL = "select * from colores_calzado"
Set rs = dbconn.Execute(SQL, , adCmdText)
Do While Not rs.EOF
If Text1.Text = rs!Color Then
Label4.Caption = Text1.Text
End If
rs.MoveNext
Loop
rs.Close
'Cierra la conexion a la base de datos
dbconn.Close

If Label4.Caption = Text1.Text Then
'If Val(Text3.Text) = Val(Label15.Caption) And Text2.Text = Label14.Caption Then
MsgBox "El color ya está ingresado", vbExclamation, "Ya existe el color"
Else
'dbconn.Close
SQL = "INSERT INTO colores_calzado (color) VALUES ('" & Text1.Text & "')"
MsgBox "se agrego: " & Text1.Text & " "
dbconn.Open
Set rs = dbconn.Execute(SQL, , adCmdText)
'rs.Close
dbconn.Close

End If
End Sub

'===========
pd: en las FAQs hay ejemplos, hay ke buscar un pokitito debés en cuando, salu2
__________________
LA MUERTE ESTÁ TAN SEGURA DE VENCER QUE NOS DA TODA UNA VIDA DE VENTAJA