Run time error 3251 Current Recordset does not support updating, this may be a limitation of the provider, or of the selected Locktype
Friends, I have a VB application that is using Oracle backend database. My code is as below but returns the above error when I try to add data.Kindly assist.
Private Sub cmdsave_Click()
rs.AddNew
rs!ID = txtID.Text
rs!Name = txtNAME.Text
rs!GROUPID = txtGROUPID.Text
rs!DATERECEIVED = txtDATERECEIVED.Text
rs!MODEL = txtMODEL.Text
rs!SERIALNO = txtSERIALNO.Text
rs!CERTIFIEDBY = txtCERTIFIEDBY.Text
rs!PROCUREMENTOFFICER = txtPROCUREMENTOFFICER.Text
rs!RECIEVEDBY = txtRECIEVEDBY.Text
rs.Update
txtID.Text = ""
txtNAME.Text = ""
txtGROUPID.Text = ""
txtDATERECEIVED.Text = ""
txtMODEL.Text = ""
txtSERIALNO.Text = ""
txtCERTIFIEDBY.Text = ""
txtPROCUREMENTOFFICER.Text = ""
txtRECIEVEDBY.Text = ""
If rs.BOF <> True And rs.EOF <> True Then
rs.MoveLast
i = Val(rs!ID)
i = i + 1
txtID.Text = i
Else
txtID.Text = 1
End If
'cmdRefresh_Click
txtID.SetFocus
'deIT.rsrecieve.Update
End Sub
Private Sub Form_Load()
'txtNAME.SetFocus
End Sub
Dim i As Integer, j As Integer
cn.ConnectionString = "Provider=MSDAORA.1;Password=3389mine;User ID=system;Data Source=192.168.167.22;Persist Security Info=True"
cn.Open
rs.Open "select * from ITINVENTORY order by ID", cn, adOpenDynamic, adLockOptimistic
If rs.BOF <> True And rs.EOF <> True Then
rs.MoveLast
i = Val(rs!ID)
i = i + 1
txtID.Text = i
Else
txtID.Text = 1
End If
txtNAME.Text = ""