A Problem with ADODB and update

T

-=TheWalkman=-

i have been progrmaing in Vb Access and this script send me an error.

"the recorsert don't allow updates"

what's should i do?

it's is the script

---------------------------------------------
Private Sub button_1_Click()
Dim rs As New ADODB.Recordset
rs.ActiveConnection = CurrentProject.Connection
rs.Open "Select * From example_tabla", CurrentProject.Connection,
adOpenDynamic, adLockOptimistic

If IsNull(box_a) Then
Beep
MsgBox "Falta seleccionar A", vbExclamation, "Formulario de
Prueba"
box_a.SetFocus
ElseIf IsNull(box_b) Then
Beep
MsgBox "Falta seleccionar B", vbExclamation, "Formulario de
Prueba"
box_b.SetFocus
ElseIf IsNull(box_c) Then
Beep
MsgBox "Falta Seleccionar C", vbExclamation, "Formulario de
Prueba"
box_c.SetFocus
Else

With rs
.AddNew
.Fields("exa_a") = box_a
.Fields("exa_b") = box_b
.Fields("exa_c") = box_c
.Update
.Close
End With
End If


End Sub



thks a lot, and sorry for the bad english i'm form chile
 
P

Pieter Wijnen

Does the Table have a Primary Key (if not create one)?
Also it's a good idea to add a Field with DataType TimeStamp

HTH

Pieter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top