Why my recordset is not working?

  • Thread starter Thread starter hanski
  • Start date Start date
H

hanski

hi.

Very simple recorset but do not work.

It won't add anything to database!! Database have only one field called
city.

Code is:

Private Sub button_Click()

Dim vtputki As New ADODB.Connection
Dim vtht As New ADODB.Recordset

Set vtputki = CurrentProject.Connection

vtht.Open "select * from dbo_cities", vtputki, adOpenDynamic,
adLockBatchOptimistic

vtht.AddNew
vtht!city = "London"
vtht.Update
vtht.Close

End Sub


hannu
 
sorry it was my mistake.

instead of adLockBatchOptimistic it should be adLockOptimistic.

hannu


Jeff Boyce kirjoitti:
 

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

Back
Top