
.addnew method ADO does not work pls help
I am writing an app in Vb6 using ADO to connect and manipulate data stored
on a SQLserver 7
I wrote a procedure to add a record to a table using the .addnew method of
the recordset
The procedure runs without a hitch but does not create any records what so
ever.
Has anyone got any good ideas?
Many thanks in advance.
Code:
With adorsBilag
.Open "SELECT * FROM bilag", , adOpenDynamic, adLockBatchOptimistic,
adCmdText
.AddNew
!bilagtype = cboBilagtype.ListIndex - 1
!bilagansvarlig = cbobilagansvarlig.ListIndex - 1
!bilagst?rrelse = Val(txtBilagst?rrelse)
!bilagdato = Format(dtpBilagdag.Value, "m/d/yy")
!bilagoppgj?rid = 1
If chkKontant = vbChecked Then
!bilagkontant = True
Else
!bilagkontant = False
End If
.Update
.Close
End With